Newbie here, trying to convert a WAV file that's recorded in arecord so that it can be converted into text.
This is the code that I'm using:
echo "Recording your Speech (Ctrl+C to Transcribe)"
arecord -D plughw:0,0 -q -f cd -t wav -d 0 -r 16000 | flac - -f --best --sample-rate 16000 -s -o daveconroy.flac;
echo "Converting Speech to Text..."
wget -q -U "Mozilla/5.0" --post-file daveconroy.flac --header "Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium" | cut -d\" -f12 > stt.txt
echo "You Said:"
value=`cat stt.txt`
The problem is that I get this error message each time and it doesn't transcribe:
ERROR: raw format options (--endian, --sign, --channels, --bps, and --sample-rate) are not allowed for non-raw input"
If I remove --sample-rate 16000 it stops the error but no text is recorded and I know the mic is being recorded.
Original code is from: https://www.daveconroy.com/turn-raspberry-pi-translator-speech-recognition-playback-60-languages/
Can I use something else in to set the sample rate? Have I missed something?