GeezerVison is showing github.com — Unable to retrieve transcript from async API · Issue #553 · GoogleCloudPlatform/python-docs-samples
Unable to retrieve transcript from async API #553DescriptionI converted my files from MP3s to FLAC, and uploaded them to a bucket.
- Using the gRPC version of this, I get no transcript:
python transcribe_async.py --encoding LINEAR16 --sample_rate 16000 gs://sieling-wav/10000.flac
name: "3946981841087526250"
Waiting for server processing...
Waiting for server processing...
etc, for some time.
- Alternately, if I do this with the "api-client" version, I get JSON responses when it succeeds, but not the transcript:
{"metadata": {"startTime": "2016-10-05T00:05:38.830764Z", "progressPercent": 100, "@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeMetadata", "lastUpdateTime": "2016-10-05T00:06:22.396557Z"}, "name": "6946489939306634899", "done": true, "response": {"@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeResponse"}}
It appears that the API is doing the work (it takes 10-30 seconds to be marked as complete). I know this probably isn't in your power to change, but it would be nice if you could just store the transcript results in another storage bucket.
Is there some form of debugging I can enable to get you more information? Activitypuneith commented on Oct 5, 2016 @garysieling The encoding you have specified is LINEAR16 which takes a .raw file. Once, you fix it from .flac to .raw it should work for you.
Re: Another storage bucket - that's not supported and for that reason we have the long running operation see sample code here and proto definition here
Hope it helps! garysieling commented on Oct 6, 2016 Thanks, I converted some of the files to RAW, and now I'm getting a quota error with both my files and the examples provided in this project. What puzzles me is that is the Quotas screen doesn't show me near any limits.
D:\projects\python-docs-samples\speech\api-client>python transcribe_async.py gs://sieling-wav/10000.raw
Traceback (most recent call last):
File "transcribe_async.py", line 100, in
main()
File "transcribe_async.py", line 73, in main
response = service_request.execute()
File "D:\Software\Anaconda3\lib\site-packages\oauth2client\util.py", line 137, in positional_wrapper
return wrapped(_args, *_kwargs)
File "D:\Software\Anaconda3\lib\site-packages\googleapiclient\http.py", line 838, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 429 when requesting https://speech.googleapis.com/v1beta1/speech:asyncrecognize?alt=json returned "Quota exceeded."> puneith commented on Oct 6, 2016 You are using the rest sample which doesn't take the gcs location. Can you please use grpc async sample. garysieling commented on Oct 6, 2016 Thanks, I tried that as well but I should have included the error:
D:\projects>cd python-docs-samples\speech\grpc
D:\projects\python-docs-samples\speech\grpc>python transcribe_async.py gs://sieling-wav/10000.raw --encoding LINEAR16
Traceback (most recent call last):
File "D:\Software\Anaconda3\lib\site-packages\grpc\beta_client_adaptations.py", line 201, in _blocking_unary_unary
credentials=_credentials(protocol_options))
File "D:\Software\Anaconda3\lib\site-packages\grpc_channel.py", line 481, in call
return _end_unary_response_blocking(state, False, deadline)
File "D:\Software\Anaconda3\lib\site-packages\grpc_channel.py", line 432, in _end_unary_response_blocking
raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.RESOURCE_EXHAUSTED, Quota exceeded.)>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "transcribe_async.py", line 121, in
main(args.input_uri, args.encoding, args.sample_rate)
File "transcribe_async.py", line 74, in main
), DEADLINE_SECS)
File "D:\Software\Anaconda3\lib\site-packages\grpc\beta_client_adaptations.py", line 305, in call
self._request_serializer, self._response_deserializer)
File "D:\Software\Anaconda3\lib\site-packages\grpc\beta_client_adaptations.py", line 203, in _blocking_unary_unary
raise _abortion_error(rpc_error_call)
grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.RESOURCE_EXHAUSTED, details="Quota exceeded.") puneith commented on Oct 6, 2016 jerjou commented on Oct 11, 2016 @garysieling - I'm guessing you authenticated by running gcloud beta auth application-default login? If so, try downloading a service account json file instead, and set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to that json file. Then try again and see if you still see the quota error. garysieling commented on Oct 11, 2016 Yes, I used a service account. I uploaded the "quit.raw" file to my bucket as @puneith recommended, and was able to transcribe that particular file.
I verified that the files I've uploaded can be played (on my machine) and are within the limits specified in Google's docs. At this point I think the service is having issues with my files, but I can't find any way to tell what the problem could be, so I'm leaning toward using a different service. puneith commented on Oct 11, 2016 @garysieling we would like to figure out why its not working for you. Can you please send us the files you are trying to transcribe. Also, on the limits I also meant the API usage limits. garysieling commented on Oct 11, 2016 puneith commented on Oct 11, 2016 You can either attach them here or send us gcs links (make sure you have made it public) if you are ok with that. garysieling commented on Oct 11, 2016 Alright, I've chosen a 6 minute file to test, as that should not hit any limits. The source file is an MP3, which I converted to WAV for a different service, and then to flac using sox. I uploaded all three so that you can compare. I verified that the flac file can be played with VLC. These are set to public:
gs://gsieling-flac/14823.flac
gs://gsieling-flac/14823.wav
gs://gsieling-flac/14823.mp3
Here is the command I used to do the flac conversion, which I obtained from Google's documentation (https://cloud.google.com/speech/support):
sox 14823.wav --channels=1 --bits=16 14823.flac
In previous attempts, I also used "-v 0.98", but I found that I still have issues without it.
I'm running this on Windows, tried both through git bash and through the normal command line. The output below is from an example. This is the same as I reported earlier on the ticket, so this is just to prove that I have the same issue for this specific file.
(D:\Software\Anaconda2) d:\projects\python-docs-samples\speech\grpc>python transcribe_async.py --encoding LINEAR16 gs://gsieling-flac/14823.flac
name: "4477754282778296532"
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing...
Waiting for server processing... puneith commented on Oct 12, 2016 @garysieling There is one error in your command. Please follow steps below:
- Convert the .flac to .raw using command `sox 14823.flac 14823.raw'
- Check the details of the .flac file
soxi 14823.flac
Input File : '14823.flac'
Channels : 1
Sample Rate : 22050
Precision : 16-bit
Duration : 00:06:05.66 = 8062848 samples ~ 27424.7 CDDA sectors
File Size : 9.62M
Bit Rate : 211k
Sample Encoding: 16-bit FLAC
Comment : 'Comment=Processed by SoX'
- Make sure you can play the .raw file
play --channels=1 --bits=16 --rate=22050 --encoding=signed-integer --endian=little 14823.raw
- Now push the .raw file to gcs say gs://gsieling-flac/14823.raw
python transcribe_async.py --encoding LINEAR16 gs://gsieling-flac/14823.raw
I ran it on my machine and got the output. Please, note this is a big audio file and it takes a bit to get the output. See output attached.
output.txt jerjou commented on Oct 12, 2016 For reference, I believe you're hitting the fact that asynchronous transcribes work only on raw files, not flac, at the moment.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|