This file contains hidden or 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 | |
| echo "Recording, press ctrl+c to stop..." | |
| arecord -D "plughw:1,0" -q -f cd -t wav | ffmpeg -loglevel panic -y -i - -ar 16000 -acodec flac speech.flac > /dev/null 2>&1 | |
| echo "Processing..." | |
| wget -q -U "Mozilla/5.0" --post-file speech.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 > speech.txt | |
| echo -n "You said: " | |
| cat speech.txt |
This file contains hidden or 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
| #!/usr/bin/env pypy | |
| import os | |
| import subprocess | |
| import sys | |
| class Env(dict): | |
| def __init__(self): | |
| ALL_PLATFORMS=['darwin/amd64', 'linux/amd64', 'linux/386', 'linux/arm', 'freebsd/amd64', 'freebsd/386', 'windows/amd64', 'windows/386'] | |
| envs = subprocess.check_output(['go', 'env']).strip() |