diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-07-29 19:44:10 -0700 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-07-29 19:44:10 -0700 |
| commit | 577d630ad2110fbde73008c2ba96f38319024334 (patch) | |
| tree | 8d231328bc461572e31572de3cf0a954199e9611 /client/main.py | |
| parent | 526f86a138a2145c4342e76e2d7dd795f60013a7 (diff) | |
| download | jasper-client-577d630ad2110fbde73008c2ba96f38319024334.tar.gz jasper-client-577d630ad2110fbde73008c2ba96f38319024334.zip | |
Addressed CR comments.
Diffstat (limited to 'client/main.py')
| -rw-r--r-- | client/main.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/client/main.py b/client/main.py index ccafdb9..3fc728f 100644 --- a/client/main.py +++ b/client/main.py @@ -2,7 +2,6 @@ import yaml import sys import speaker import stt -from stt import PocketSphinxSTT from conversation import Conversation @@ -24,12 +23,17 @@ if __name__ == "__main__": profile = yaml.safe_load(open("profile.yml", "r")) try: - google_api_key = profile['google_api_key'] + api_key = profile['keys']['GOOGLE_SPEECH'] except KeyError: - print "Google STT API Key not present in profile - defaulting to PocketSphinx..." - google_api_key = None + api_key = None - mic = Mic(speaker.newSpeaker(), PocketSphinxSTT(), stt.newSTTEngine(google_api_key)) + try: + stt_engine_type = profile['stt_engine'] + except KeyError: + print "stt_engine not specified in profile, defaulting to PocketSphinx" + stt_engine_type = "sphinx" + + mic = Mic(speaker.newSpeaker(), stt.PocketSphinxSTT(), stt.newSTTEngine(stt_engine_type, api_key=api_key)) addendum = "" if 'first_name' in profile: |
