Created
June 17, 2013 22:49
-
-
Save scottcagno/5801211 to your computer and use it in GitHub Desktop.
Simple Google Speech Recognition API Hook. ----- requires -------
sudo apt-get install sox, curl
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 | |
sox -q -r 16000 -b 16 -c 1 -d a.flac silence 1 0.3 1% 1 0.5 1% 2>/dev/null | |
curl -s --data-binary @a.flac --header 'Content-Type: audio/x-flac; rate=16000' 'https://www.google.com/speech-api/v1/recognize?client=chromium&lang="en-us"' | cut -d"," -f3 | sed 's/^.*utterance\":\"\(.*\)\"$/\1/g' | |
rm a.flac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment