0
votes

So, to confirm: I believe I have set everything up correctly as I was able to run the sample code for the recognize-long-running method. It quickly returned a name and a json file with the transcription.

However, when I try to run the same code for my own audio sample, nothing happens. The API dashboard shows that a request came through, but my Terminal hangs with no response. I am using a Mac, High Sierra 10.13.6, and running the code from the command line. I also have a project set up in Google Cloud Platform and have the file in question uploaded in flac format. Noteworthy, perhaps: my sample has a bitrate of 48000, which is higher than their recommended one, so perhaps this is messing things up?

I will paste the sample code that works below, in addition to my code.

Working sample code from Google:

gcloud ml speech recognize-long-running \ 'gs://cloud-samples-tests/speech/brooklyn.flac' \ --language-code='en-US' --async

My code:

gcloud ml speech recognize-long-running \ 'gs://interviewtexttospeechconversions/MelvinWeek4.flac’ \      --language-code='en-US' --async --

1

1 Answers

0
votes

I think that your terminal is getting hang with no response since you are using a (`) character to close the file name quote instead of the (') character. Additionally, I think is required to remove the -- symbol, located at the end of the gcloud command, in case you are not planning to add another parameter.

gcloud ml speech recognize-long-running 'gs://interviewtexttospeechconversions/MelvinWeek4.flac' --language-code='en-US' --async

Finally, I recommend you to include the sample-rate and encoding parameters that can help you to avoid invalid configuration issues.