Skip to content

Instantly share code, notes, and snippets.

View albandaft's full-sized avatar

Alban albandaft

View GitHub Profile
@sararob
sararob / speech-api-request.sh
Last active August 12, 2019 21:48
Bash script for recording audio and calling the Cloud Speech API
#!/bin/bash
# SETUP
# 1) This requires having SoX (http://sox.sourceforge.net/) installed. On a Mac, you can do this with `brew install sox --with-flac`
# 2) You'll also need an API key for your Google Cloud Platform project: https://support.google.com/cloud/answer/6158862
# Create a request file with our JSON request in the current directory
FILENAME="request-"`date +"%s".json`
cat <<EOF > $FILENAME
{