GeezerVison is showing github.com — Python Async dumps problem Speech API · Issue #588 · GoogleCloudPlatform/python-docs-samples
Python Async dumps problem Speech API #588DescriptionHi,
with the transcribe_async.py file i can't get my results back.
The only changes that i made in transcribe_async.py are:
- Language
- Raw file passed by uri.
The error is in print(json.dumps(response['response']['results']))
Python says that the error is the Key 'results'
I try to fix it, but i can't understand what is wrong in this program.
I hope you can help me.
Thanks Activitytheacodes commented on Oct 18, 2016 Hi @Dellax8 , can you try changing that line to print(json.dumps(response)) and sending us the output? puneith commented on Oct 18, 2016 @Dellax8 Do you mean rest or grpc transcribe_async.py? Also can you let us know what language you changed it to? Dellax8 commented on Oct 19, 2016 @jonparrott
{"done": true, "metadata": {"lastUpdateTime": "2016-10-18T15:46:35.033374Z", "progressPercent": 100, "startTime": "2016-10-18T15:46:28.054832Z", "@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeMetadata"}, "name": "#NAME#", "response": {"@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeResponse"}}
@puneith
I Try with REST. Now i Try with grpc but i can't' understand what is wrong.
The language is it-IT but i think that this is not the problem. Dellax8 commented on Oct 19, 2016 with grpc transcribe_async.py i can't compile.
there are errors in "
from google.cloud.credentials import get_credentials
from google.cloud.speech.v1beta1 import cloud_speech_pb2
from google.longrunning import operations_grpc_pb2
from grpc.beta import implementations"
the errors are in the import part.
I have installed the requirements by pip, but it's not working yet puneith commented on Oct 19, 2016 @Dellax8 Can you paste the error you are getting? Dellax8 commented on Oct 20, 2016 @puneith
in grpc - i fix the import error, but the result is empty...
in REST -
print(json.dumps(response['response']['results']))
KeyError: 'results' puneith commented on Oct 20, 2016 Can you send me the audio file if you don't mind. Dellax8 commented on Oct 20, 2016 the encoding was wrong
I create a new file but it doesn't work
This is the audio Raw File
teone2.zip jerjou commented on Oct 21, 2016 Hello - note that if you have encoded the file with different parameters than the sample one, you'll have to change the configuration parameters you send to the API. In this case, it looks like your audio file was encoded with a sample rate near 32000, which means you'll have to change the sampleRate parameter to match.
I was able to get at least a partial result from the API after changing the sampleRate and language parameters, though I wasn't able to verify since I don't speak italian :) Anyway, based on that I believe this should resolve this issue - please reopen this issue if it doesn't!
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|