1
votes

I am trying to use Google's Speech Recognition API from a shell command, but I am having issues.

My Shell file contains the following Code:

arecord -D plughw:1,0 -q -f cd -t wav -R 16000 | flac - -f --best --sample-rate=16000 -s -o test.flac

wget -q -U "Mozilla/5.0" --post-file test.flac --header "Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v2/recognize?client=chromium&lang=en-US&key=MyKey" | >stt.txt

I have validated that the test.flac file does contain my recording. Also, I have confirmed that the Google Server is indeed receiving my requests. Meanwhile, I am returned a Null result from the Web Server.

2
The syntax used to create my file was wrong. It should have been the following: arecord -D plughw:1,0 -q -t wav -r 16000 file.wav and then flac -f --sample-rate=16000 -s file.wavJF0001
Ok, great then, maybe I was wrong. You could answer your question.Nikolay Shmyrev

2 Answers

0
votes

The syntax used to create my file was wrong. It should have been the following:

arecord -D plughw:1,0 -q -t wav -r 16000 file.wav

flac -f --sample-rate=16000 -s file.wav

0
votes

Use http://www.audacityteam.org/ to double check that your file is 16bit-PCM and mono.

enter image description here