Kitt-AI / snowboy

Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
Other
3.08k stars 997 forks source link

How to end the detector loop? #361

Closed saket404 closed 6 years ago

saket404 commented 6 years ago

How do i end the detector loop after it detects a hot word? So i am calling the wake_word() function in another python file but i just want it to detect a hotword a single time and break out.

chenguoguo commented 6 years ago

https://github.com/Kitt-AI/snowboy/blob/master/examples/Python/demo4.py

saket404 commented 6 years ago

Hello I have tested the demo but i think you misunderstood my question sir. I meant like when it detects the wake word i want it to break the loop. The demo jumps to google recognition and after it does the recognition it still goes back to the wake word loop. I want to break out of that wake word loop. The detector.start()

Thanks Saket

chenguoguo commented 6 years ago

You can simply use the break statement in Python instead of using the callback function.