jasperproject/jasper-client — pull request #118 by astahlman (2014-07-27 00:42:48+00:00)
Title: Modularized STT implementation

# Overview
This commit abstracts out the Speech To Text engine into a new module: stt.py. Users now have the option to specify a Google API key in their profile. If this key is present, Jasper will rely on the Google Speech API to transcribe audio during the active listen phase. The default behavior still uses the PocketSphinx engine for audio transcription.

# Motivation
* https://github.com/jasperproject/jasper-client/issues/29
* [TODO #6](https://github.com/jasperproject/jasper-client/blob/master/CONTRIBUTING.md#todos)

There is a stark difference between the performance of the Google Speech API and the PocketSphinx performance. I rarely ever need to repeat myself anymore.

# Testing
* Manual testing on both OS X and Raspberry Pi using the PocketSphinx engine as well as the Google Speech API
* Updated tests, boot/test.py and client/test.py both pass.

# Prerequisites
The new STT implementation requires a Google API key to be present in profile.yml

To obtain an API key:
1. Join the [Chromium Dev group](https://groups.google.com/a/chromium.org/forum/?fromgroups#!forum/chromium-dev)
2. Create a project through the [Google Developers console](https://console.developers.google.com/project)
3. Select your project. In the sidebar, navigate to "APIs & Auth." Activate the Speech API.
4. Under "APIs & Auth," navigate to "Credentials." Create a new key for public API access.
5. Copy your API key and run

cd client/; python populate.py

When prompted, paste this key for access to the Speech API.

This implementation also requires that either the ffmpeg or avconv audio utility be present on your $PATH. To install on RPi, simply run

sudo apt-get install libav-tools

# Acknowledgements
This was inspired by @fritz-fritz 's [fork](https://github.com/fritz-fritz/jasper-client/tree/master/client)