Created
August 5, 2013 14:53
-
-
Save mikerr/6156516 to your computer and use it in GitHub Desktop.
Record 3 seconds of audio from mic, and transcribe it using googles api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
arecord -D "plughw:1,0" -q -d 3 -f cd -t wav | ffmpeg -loglevel panic -y -i - -ar 16000 -acodec flac file.flac > /dev/null 2>&1 | |
wget -q -U "Mozilla/6.0" --post-file file.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 | |
rm file.flac > /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment