{"action":"closed","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2519","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2519/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2519/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/issues/2519/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2519","id":181856286,"number":2519,"title":"speech api with sample content bytes is not encoded to ASCII string before being sent over the wire","user":{"login":"INRIX-Avilay-Parekh","id":18447684,"avatar_url":"https://avatars.githubusercontent.com/u/18447684?v=3","gravatar_id":"","url":"https://api.github.com/users/INRIX-Avilay-Parekh","html_url":"https://github.com/INRIX-Avilay-Parekh","followers_url":"https://api.github.com/users/INRIX-Avilay-Parekh/followers","following_url":"https://api.github.com/users/INRIX-Avilay-Parekh/following{/other_user}","gists_url":"https://api.github.com/users/INRIX-Avilay-Parekh/gists{/gist_id}","starred_url":"https://api.github.com/users/INRIX-Avilay-Parekh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/INRIX-Avilay-Parekh/subscriptions","organizations_url":"https://api.github.com/users/INRIX-Avilay-Parekh/orgs","repos_url":"https://api.github.com/users/INRIX-Avilay-Parekh/repos","events_url":"https://api.github.com/users/INRIX-Avilay-Parekh/events{/privacy}","received_events_url":"https://api.github.com/users/INRIX-Avilay-Parekh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-python/labels/speech","name":"speech","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-09T00:23:15Z","updated_at":"2016-10-11T13:22:57Z","closed_at":"2016-10-11T13:22:57Z","body":"When using the package as under with python3.5 -\r\n\r\n    with open('linear.wav', 'rb') as f:\r\n        data = f.read()\r\n\r\n    s = client.sample(data, None, encoding=Encoding.LINEAR16, sample_rate=16000)\r\n    texts = client.sync_recognize(s)\r\n\r\nThrows an error that it is not possible to convert the byte stream to JSON.\r\n\r\nIn `speech/google/cloud/speech/client.py#240` the following line encodes the bytes in base64 but the return type of b64encode is still bytes.\r\n\r\n    audio = {'content': b64encode(_to_bytes(sample.content))}\r\n\r\nIf this is changed to the following, the API behaves as expected -\r\n\r\n    audio = {'content': b64encode(_to_bytes(sample.content)).decode('ascii')}\r\n"}}
{"actor":{"display_login":"daspecster"}}