speech-api returning empty results no matter what

1,256 views
Skip to first unread message

E. Schmidbauer

unread,
Mar 5, 2015, 10:35:52 AM3/5/15
to Chromium-dev
Hello,
I'm trying to test out google's speech API using just simple curl command.
No matter what I try (different files/sample rates/etc...) google
returns an empty JSON result.

Here is my call:

curl -X POST --data-binary @audio/message.flac --header 'Content-Type:
audio/x-flac; rate=16000;'
'https://www.google.com/speech-api/v2/recognize?output=json&lang=en-US&key=___API_KEY___&maxresults=9&pfilter=0'


Any ideas?

Thanks,
E

Anand Mistry

unread,
Mar 5, 2015, 6:23:27 PM3/5/15
to chromi...@chromium.org
That API is only for Chrome and Chromium development/testing.

Igor Rodriguez

unread,
Mar 6, 2015, 2:46:40 AM3/6/15
to chromi...@chromium.org
Do you have your own API KEY? If you got it try with this call:

curl -X POST \
--data-binary @'PATH_TO_YOUR_FILE' \
--header 'Content-Type: audio/l16; rate=16000;' \

E. Schmidbauer

unread,
Mar 6, 2015, 8:10:30 AM3/6/15
to Chromium-dev
Hi Igor,
I tried that as you specified. I know my API key is valid because if I
change it (to something invalid) I get an error

curl -X POST --data-binary @audio/message.flac --header 'Content-Type:
audio/x-flac; rate=16000;'
'https://www.google.com/speech-api/v2/recognize?output=json&lang=en-US&client=chromium&maxresults=1&key=___KEY____'


Only returns:

{"result":[]}
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to chromium-dev...@chromium.org.

Igor Rodriguez

unread,
Mar 6, 2015, 9:06:12 AM3/6/15
to chromi...@chromium.org
If you tried with my example, your audio data should be in "wav" format. Can you try it with a wav audio recording? 

E. Schmidbauer

unread,
Mar 6, 2015, 9:53:38 AM3/6/15
to Chromium-dev
Hi Igor,
I tried with your example too:

curl -X POST --data-binary @'hello (16bit PCM).wav' --header
'Content-Type: audio/l16; rate=16000;'
'https://www.google.com/speech-api/v2/recognize?output=json&lang=en-US&client=chromium&maxresults=1&key=__KEY__'


Still only returns:

{"result":[]}

Thanks
/E

Christian Biesinger

unread,
Mar 6, 2015, 12:08:29 PM3/6/15
to e.schm...@gmail.com, chromium-dev

This mailing list is not an appropriate place to discuss how to break Google's terms of service.

-christian

Rohit Kumar

unread,
Dec 10, 2018, 12:13:56 PM12/10/18
to Chromium-dev
Did you find any solution? I am stuck in a very similar situation. Not matter what I send, wav files, mp3, RAW files or linear16, I always get empty response.

ghislain mega lutumba

unread,
Dec 18, 2018, 8:28:43 AM12/18/18
to Chromium-dev
for more information add to the location in the Chrome iOS project go to www.kivumakers.com
Reply all
Reply to author
Forward
0 new messages