Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to retrieve transcript from async API #553

Closed
garysieling opened this issue Oct 5, 2016 · 13 comments
Closed

Unable to retrieve transcript from async API #553

garysieling opened this issue Oct 5, 2016 · 13 comments
Assignees
Labels

Comments

@garysieling
Copy link

I converted my files from MP3s to FLAC, and uploaded them to a bucket.

  1. 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.

  1. 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?

@puneith
Copy link
Contributor

puneith commented 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
Copy link
Author

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
Copy link
Contributor

puneith commented Oct 6, 2016

You are using the rest sample which doesn't take the gcs location. Can you please use grpc async sample.

@garysieling
Copy link
Author

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
Copy link
Contributor

puneith commented Oct 6, 2016

@garysieling Are you getting the same error in the file which has been provided resources/quit.raw? I just want to confirm that you have followed these limits? https://cloud.google.com/speech/limits

@jerjou
Copy link
Contributor

jerjou commented 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
Copy link
Author

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
Copy link
Contributor

puneith commented 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
Copy link
Author

I can do that, what's the easiest way for me to send these?

On Tue, Oct 11, 2016 at 3:04 PM, puneith [email protected] wrote:

@garysieling https://github.com/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.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#553 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAVX4eIYPXhg0yvkUezsA5Im2SXdbF_kks5qy92_gaJpZM4KOSwC
.

Gary Sieling
www.garysieling.com/blog

@puneith
Copy link
Contributor

puneith commented 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
Copy link
Author

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
Copy link
Contributor

puneith commented Oct 12, 2016

@garysieling There is one error in your command. Please follow steps below:

  1. Convert the .flac to .raw using command `sox 14823.flac 14823.raw'
  2. 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'

  1. Make sure you can play the .raw file
    play --channels=1 --bits=16 --rate=22050 --encoding=signed-integer --endian=little 14823.raw
  2. 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
Copy link
Contributor

jerjou commented 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.

telpirion pushed a commit that referenced this issue Jan 18, 2023
* chore(deps): update all dependencies to v2.15.1

* revert

Co-authored-by: Anthonios Partheniou <[email protected]>
dandhlee pushed a commit that referenced this issue Feb 6, 2023
* chore(deps): update all dependencies to v2.15.1

* revert

Co-authored-by: Anthonios Partheniou <[email protected]>
telpirion pushed a commit that referenced this issue Mar 13, 2023
* chore(deps): update all dependencies to v2.15.1

* revert

Co-authored-by: Anthonios Partheniou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants