Asynchronous speech recognition starts a long running audio processing operation. Use asynchronous speech recognition to recognize audio that is longer than a minute. For shorter audio, Synchronous Speech Recognition is faster and simpler.You can retrieve the results of the operation via the google.longrunning.Operations interface. Results remain available for retrieval for 5 days (120 hours). Audio content can be sent directly to Cloud Speech-to-Text or it can process audio content that already resides in Google Cloud Storage. See also the audio limits for asynchronous speech recognition requests.
This resource represents a long-running operation that is the result of a network API call.
done - boolean
If the value is
false, it means the operation is still in progress. If
true, the operation is completed, and either
responseis available.Union field
result. The operation result, which can be either an
erroror a valid
responseis set. If
true, exactly one of
resultcan be only one of the following:
awaitit seems like there isn't a way to get response before the result is ready. Which would not work in a cloud function.
responsesexample, from second
then.I've shorten the data in Buffer attributes for brevity.
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
namethat you get in
firebaseApiKeyyou can find it in google cloud console. You do not need this API key if calling this end point within a firebase function.
nameis a string and is
The name of the operation resource.
nameattribute of the
initialApiResponseit would be possible to do pooling and gets the latest state of a long-running operation. Including result when it's done. via the