|
|
@@ -22,19 +22,6 @@ def _init_logging():
|
|
|
logging.basicConfig(filename=Config.LOGFILE)
|
|
|
logging.getLogger().setLevel(logging.DEBUG)
|
|
|
|
|
|
-def cb():
|
|
|
- print 'CB!'
|
|
|
-
|
|
|
-def test():
|
|
|
- import snowboy.snowboydecoder
|
|
|
- model = 'resources/snowboy/alexa.umdl'
|
|
|
- detector = snowboy.snowboydecoder.HotwordDetector(model, sensitivity=0.5)
|
|
|
- print 'a'
|
|
|
- detector.start(detected_callback=cb, interrupt_check=_interrupt_callback)
|
|
|
- print 'b'
|
|
|
- detector.terminate()
|
|
|
- print 'c'
|
|
|
-
|
|
|
def _run(cclient):
|
|
|
_init_logging()
|
|
|
signal.signal(signal.SIGINT, _signal_handler)
|
|
|
@@ -44,13 +31,9 @@ def _run(cclient):
|
|
|
services.launch_services(cclient, _interrupt_callback, _signal_handler)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
- if False:
|
|
|
- test()
|
|
|
-
|
|
|
- else:
|
|
|
- cclient = util.curses_util.CursesClient()
|
|
|
- cclient.title = 'voice_control'
|
|
|
- cclient.show_cursor = False
|
|
|
- input_sources.CURSES_CLIENT = cclient
|
|
|
- output.CURSES_CLIENT = cclient
|
|
|
- cclient.run(_run, intercept_output_streams=True, cclient=cclient)
|
|
|
+ cclient = util.curses_util.CursesClient()
|
|
|
+ cclient.title = 'voice_control'
|
|
|
+ cclient.show_cursor = False
|
|
|
+ input_sources.CURSES_CLIENT = cclient
|
|
|
+ output.CURSES_CLIENT = cclient
|
|
|
+ cclient.run(_run, intercept_output_streams=True, cclient=cclient)
|