Mark Larson
Mark Larson

Reputation: 11

google speech api response is empty, even with this example test

When I run the API explorer from this page i get a 200 OK response, but the response json doesn't have any transcription. What am i doing wrong?

API Explorer location: https://cloud.google.com/speech/reference/rest/v1/speech/longrunningrecognize

Request parameters: Default

Request body:

 {
   "config": {
     "encoding": "FLAC",
     "languageCode": "en-US",
     "sampleRateHertz": 16000
   },
   "audio": {
     "uri": "gs://cloud-samples-tests/speech/brooklyn.flac"
   }
 }

Response:

{
  "name": "3497944051092250866"
}

Upvotes: 0

Views: 912

Answers (1)

Mark Larson
Mark Larson

Reputation: 11

i figured it out.

with longrunningrecognize you get back the name object and then you have to send a operations.get to retrieve your processed object.

this is explained here beautifully https://medium.com/towards-data-science/tutorial-asynchronous-speech-recognition-in-python-b1215d501c64

Upvotes: 1

Related Questions