Get result of async operation to Google speech-to-text

464 views
Skip to first unread message

Bruno Leitão

unread,
Aug 10, 2016, 8:30:55 PM8/10/16
to Google App Engine
Hi all,

I perform a async request to google speech-to-text, and now i do not know how to get the result of operation.

I already know that operation was successful

Thanks
BL

Nicholas (Google Cloud Support)

unread,
Aug 11, 2016, 12:39:40 PM8/11/16
to Google App Engine
Using speech.asyncrecognize as an example, here would be the workflow:
I hope this information and general guide is helpful.  Give it go and let me know if these behavior and values do not match with the documentation provided.

Bruno Leitão

unread,
Aug 11, 2016, 1:51:38 PM8/11/16
to Google App Engine
I'm using the Google .Net API client. When i call: AsyncRecognize, the Operation returns only the parameter Name (e.g. 123456), others are null.
With Name parameter, i'm calling operations.Get and this is the return:

{
  "name": "123456",
  "metadata": {
    "progressPercent": 100,
    "startTime": "2016-08-11T15:51:38.592569Z",
    "lastUpdateTime": "2016-08-11T15:51:40.323793Z"
  },
  "done": true,
  "response": {
  }
}

Any call to AsyncRecognize the Response parameter is null.

I need to know how can i get the result of my async operation.

Aris Alexis

unread,
Aug 14, 2016, 11:37:08 AM8/14/16
to Google App Engine, unco...@gmail.com
I have the same problem with the response, it doesn't include any result. Does this mean it didn't understand anything from the audio file? I am sending a 40seconds linear16 raw PCM 16 bit signed file with clear voices. 
If there is a problem why isn't there an error reported?

Nicholas (Google Cloud Support)

unread,
Aug 22, 2016, 4:28:13 PM8/22/16
to Google App Engine, unco...@gmail.com
Thank you for bringing this to our attention.  I have not been able to reproduce the results reported here.  When I tested a .wav PCM 16-bit little-endian signed recording, the result was exactly as described above.  I first received an operation name from the async API call and eventually got a response JSON with the Operation GET API that included transcribed text.

This may be be an issue with the audio file, language recognition, or something else specific to your use.  Please submit a new issue on our Google Cloud Platform public issue tracker and we can investigate this further.  Be sure to attach the file used and the AudioConfig sent with the recording so that we may attempt to reproduce your results.  Also, please link to it from here and back so that others may follow.

Thanks in advance for your patience.


On Wednesday, August 10, 2016 at 8:30:55 PM UTC-4, Bruno Leitão wrote:

Ohad Perry

unread,
Sep 10, 2016, 5:53:32 PM9/10/16
to Google App Engine, unco...@gmail.com
happened in both mp3 and flac files.
getting 
{
  "name": "851885438749752509",
  "metadata": {
    "progressPercent": 100,
    "startTime": "2016-09-10T20:58:37.142077Z",
    "lastUpdateTime": "2016-09-10T20:59:19.996062Z"
  },
  "done": true,
  "response": {
  }
}
and nothing else..

Ohad Perry

unread,
Sep 10, 2016, 5:53:32 PM9/10/16
to Google App Engine, unco...@gmail.com
+1 happens to me as well. the audio is in hebrew and it's an mp3 file

Dave C

unread,
Sep 29, 2016, 7:15:42 PM9/29/16
to Google App Engine, unco...@gmail.com
FYI, I experienced this same issue with LINEAR16 PCM data and setting the sampleRate to 16k.  I then realized that my actual data was at 44.1k.  After resampling, I get a reasonable response, although an error message or even an empty list of responses would be nice in the case that the recognizer didn't properly understand the audio.

The response for my admittedly malformed request was this:
{"metadata": {"@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeMetadata", "progressPercent": 100, "lastUpdateTime": "2016-09-29T21:57:16.761811Z", "startTime": "2016-09-29T21:56:56.355536Z"}, "response": {"@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeResponse"}, "name": "1622634151588923227", "done": true}

I'm not sure if it's in the docs, but I take this to mean that the absence of results field in the response indicates that the speech api did not recognize the audio.


On Wednesday, August 10, 2016 at 8:30:55 PM UTC-4, Bruno Leitão wrote:

Sam Nyavor

unread,
Oct 12, 2016, 10:29:51 AM10/12/16
to Google App Engine, unco...@gmail.com
I am also getting a response with no result and dont know how to access the result even if there was a result. How do i know if there are no results?
Reply all
Reply to author
Forward
0 new messages