diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-07-26 23:31:25 +0000 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-07-26 23:31:25 +0000 |
| commit | 78389f252a021d642a7a0146b658f0465da6e264 (patch) | |
| tree | b740c6339ceba381004d3441f2459f65d38d02a6 /client/main.py | |
| parent | 2c55f4da462383ee6c7b89ea44e5c40cd5badf0c (diff) | |
| download | jasper-client-78389f252a021d642a7a0146b658f0465da6e264.tar.gz jasper-client-78389f252a021d642a7a0146b658f0465da6e264.zip | |
Work on Google STT on RPi.
Diffstat (limited to 'client/main.py')
| -rw-r--r-- | client/main.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/main.py b/client/main.py index 4a54f3f..7920832 100644 --- a/client/main.py +++ b/client/main.py @@ -23,8 +23,13 @@ if __name__ == "__main__": profile = yaml.safe_load(open("profile.yml", "r")) - # TODO: rename 'api_key' to 'google_stt_api_key' - mic = Mic(speaker.newSpeaker(), PocketSphinxSTT(), stt.newSTTEngine(profile['api_key'])) + try: + google_api_key = profile['google_api_key'] + except KeyError: + print "Google STT API Key not present in profile - defaulting to PocketSphinx..." + google_api_key = None + + mic = Mic(speaker.newSpeaker(), PocketSphinxSTT(), stt.newSTTEngine(google_api_key)) mic.say("How can I be of service?") |
