diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-24 16:05:56 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-26 13:34:48 +0200 |
| commit | 8c71b2cc05500fc72a6bc8a925f4411f7c52c903 (patch) | |
| tree | 615756c45b5250bf1b0eea5beace743d139a39a9 /jasper.py | |
| parent | 4fc9567ff2c326c348e559c681679363b01daf59 (diff) | |
| download | jasper-client-8c71b2cc05500fc72a6bc8a925f4411f7c52c903.tar.gz jasper-client-8c71b2cc05500fc72a6bc8a925f4411f7c52c903.zip | |
Move tts_engine_slug to jasper.py, improve module functions of speaker.py
Diffstat (limited to 'jasper.py')
| -rwxr-xr-x | jasper.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -53,12 +53,19 @@ class Jasper(object): stt_engine_type = "sphinx" logger.warning("stt_engine not specified in profile, defaulting to '%s'", stt_engine_type) + try: + tts_engine_slug = self.config['tts_engine'] + except KeyError: + tts_engine_slug = speak.get_default_engine_slug() + logger.warning("tts_engine not specified in profile, defaulting to '%s'", tts_engine_slug) + tts_engine = speak.get_engine_by_slug(tts_engine_slug) + # Compile dictionary sentences, dictionary, languagemodel = [os.path.abspath(os.path.join(jasperpath.LIB_PATH, filename)) for filename in ("sentences.txt", "dictionary.dic", "languagemodel.lm")] vocabcompiler.compile(sentences, dictionary, languagemodel) # Initialize Mic - self.mic = Mic(speak.newSpeaker(), stt.PocketSphinxSTT(), stt.newSTTEngine(stt_engine_type, api_key=api_key)) + self.mic = Mic(tts_engine(), stt.PocketSphinxSTT(), stt.newSTTEngine(stt_engine_type, api_key=api_key)) def run(self): if 'first_name' in self.config: |
