Skip to main content

STT engine that listens in the background

Project description

Constant Listener

This repository was created as a utility for a home automation system. It listens in the background, and uses Google's Speech-to-Text API to give the text said through a Queue.

The general usage has it listening for overlapping chunks, so if you read the beginning of this README into the program, the Queue would have in it:
["Constant Listener", "Listener This repository was created", "story was created as a Ute", ...]


Initilization:

Pick your STT engine and follow the instructions there. You pass in a profile argument to background_speech_to_text that is a dictionary containing the relevant credentials.

Google:
Map 'key' to a valid Google Developer Key.

Follow "Step 1" here: http://progfruits.wordpress.com/2014/05/31/using-google-speech-api-from-python/
(Also, concerns raised in the article are valid.)

Sphinx:
If you are using sphinx, you need profile to have "words" mapped to a list of possible outputs.

Wit.ai:
Map 'wit_token' to a valid wit.ai token. (I use a server token, it will *probably* work with a client token.)

Usage:

To start a listener that triggers every one second and records for 4 seconds (using google STT):

profile = { "key": "My_key_here" }
q = Queue.Queue()
# Other options are "sphinx" and "wit"
background_speech_to_text(q, 4, 1, profile, "google")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

constant_listener-0.0.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page