Skip to content

Commit

Permalink
Fix config files for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
titilambert committed Aug 31, 2016
1 parent feae70e commit ccc5522
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions tests/tux/conf/tux_tests_conf_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tux:
gender: male
name: TuxDroid
hotword:
answer: "yes"
hotword: hello
model_dir: pocketsphinx-data
pins:
Expand Down
8 changes: 4 additions & 4 deletions tests/voice/conf/voice_tests_conf_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ tux:
advanced:
fake: true
log_level: DEBUG
data: {}
hotword:
hotword: hello
model_dir: pocketsphinx-data
global:
gender: male
name: TuxDroid
hotword:
answer: "yes"
hotword: hello
model_dir: pocketsphinx-data
pins:
wings:
left_switch: 17
Expand Down
10 changes: 6 additions & 4 deletions tuxeatpi/hotword/hotword.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(self, settings, tts_queue, logger):
# Init private attributes
self._settings = settings
self._must_run = True
self._rerun = True
self._config = Decoder.default_config()
if not self.prepare_decoder():
self._must_run = False
Expand Down Expand Up @@ -59,15 +60,16 @@ def prepare_decoder(self):
def stop(self):
"""Stop process"""
self._must_run = False
self._rerun = False
self.terminate()

def run(self):
"""Text to speech"""
rerun = True
self._rerun = True
self._must_run = True
self.logger.debug("starting listening hotword %s", self._hotword)
while rerun:
rerun = False
while self._rerun:
self._rerun = False
self._paudio = pyaudio.PyAudio()
stream = self._paudio.open(format=pyaudio.paInt16, channels=1, rate=16000,
input=True, frames_per_buffer=1024)
Expand All @@ -82,7 +84,7 @@ def run(self):
self.logger.debug("Hotword detected")
self.tts_queue.put(gtt(self._answer))
# TODO run nlu audio detection
rerun = True
self._rerun = True
break
self._decoder.end_utt()

Expand Down

0 comments on commit ccc5522

Please sign in to comment.