|
|
@@ -1,9 +1,8 @@
|
|
|
import logging
|
|
|
-import snowboy.snowboydecoder
|
|
|
-import sys
|
|
|
+#import snowboy.snowboydecoder
|
|
|
import signal
|
|
|
import ears
|
|
|
-import tts
|
|
|
+import output
|
|
|
|
|
|
# Demo code for listening two hotwords at the same time
|
|
|
|
|
|
@@ -36,7 +35,7 @@ def _callback(model):
|
|
|
if keyword in model['callbacks']:
|
|
|
return model['callbacks'][keyword].call(trigger=keyword, additional_tokens=tokens[1:])
|
|
|
|
|
|
- tts.tts('callback failed.')
|
|
|
+ output.failure()
|
|
|
|
|
|
def loop_model(model):
|
|
|
signal.signal(signal.SIGINT, _signal_handler)
|
|
|
@@ -57,11 +56,11 @@ def start(models):
|
|
|
logging.info('Launching Snowboy hotword detector...')
|
|
|
signal.signal(signal.SIGINT, _signal_handler)
|
|
|
|
|
|
- detector = snowboy.snowboydecoder.HotwordDetector(decoder_model=models[0]['model'],
|
|
|
- resource='/home/martin/workspaces/visual-code/voice_control/resources/snowboy/common.res',
|
|
|
- sensitivity=DEFAULT_SENSITIVITY)
|
|
|
+ #detector = snowboy.snowboydecoder.HotwordDetector(decoder_model=models[0]['model'],
|
|
|
+ # resource='/home/martin/workspaces/visual-code/voice_control/resources/snowboy/common.res',
|
|
|
+ # sensitivity=DEFAULT_SENSITIVITY)
|
|
|
|
|
|
logging.info('Stream opened.')
|
|
|
|
|
|
- detector.start(detected_callback=callbacks[0], interrupt_check=_interrupt_callback, sleep_time=0.03)
|
|
|
- detector.terminate()
|
|
|
+ #detector.start(detected_callback=callbacks[0], interrupt_check=_interrupt_callback, sleep_time=0.03)
|
|
|
+ #detector.terminate()
|