Friday, 13 September 2013

Google speech api through wget, stuck at "HTTP request sent, awaiting response"

Google speech api through wget, stuck at "HTTP request sent, awaiting
response"

I am attempting to send a .flac file to Google, to use their speech to
text application. I am using information based of this Gist.
I started off by recording my .wav and converting it to a .flac:
arecord -D hw:1,0 -f cd -t wav -d 4 -r 16000 -c1 | flac - -f --best
--sample-rate 16000 -o /dev/shm/out.flac 1>/dev/shm/voice.log
2>/dev/shm/voice.log;
Then I attempted to send that new file, out.flac, to Google via wget:
wget -O 'recognized.json' -o /dev/null --post-file /dev/shm/out.flac
--header="Content-Type: audio/x-flac; rate=16000"
http://www.google.com/speech-api/v1/recognize?lang="en-US"
I cant seem to get any response from Google's api:
Connecting to www.google.com (www.google.com)|173.194.115.191:80...
connected.
HTTP request sent, awaiting response... No data received..
Retrying.
I am not sure what I have done wrong at this point.

No comments:

Post a Comment