summaryrefslogtreecommitdiff
path: root/client/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'client/main.py')
-rw-r--r--client/main.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/client/main.py b/client/main.py
index 6ba3645..3fc728f 100644
--- a/client/main.py
+++ b/client/main.py
@@ -1,6 +1,7 @@
import yaml
import sys
import speaker
+import stt
from conversation import Conversation
@@ -21,8 +22,18 @@ if __name__ == "__main__":
profile = yaml.safe_load(open("profile.yml", "r"))
- mic = Mic(speaker.newSpeaker(), "languagemodel.lm", "dictionary.dic",
- "languagemodel_persona.lm", "dictionary_persona.dic")
+ try:
+ api_key = profile['keys']['GOOGLE_SPEECH']
+ except KeyError:
+ api_key = None
+
+ 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: