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.06k stars 997 forks source link

Integrating a hotword/wake up word with google SpeechRecognition #540

Open dipendra77 opened 5 years ago

dipendra77 commented 5 years ago

Hi, How can I integrate a hotword / wake up keyword in my application so as I can call the google speech api to perform specific command (say turn on RED LED) only after it detects the hotword defined by us. program flow should be as follows: detects a hotword(may be through another application such as mycroft or snowboy) ->selecting the input audio source-> receiving audio input-> converting speech to text-> perform operations based on the text generated. I am using a usb microphone (Respeaker 4 mic array v2.0 to be specific). I have tried with mycroft engine but once it detects the hotword the pyaudio does not seem to close the input stream and hence the google speech api is not able to access the mic for further speech to text conversion. Is there any way possible to use any hotword detector application which works with SpeechRecognition api hand in hand? Any help will be appreciated. Thank you

irthomasthomas commented 5 years ago

Check out demo4.py in the examples/Python folder

"This demo file shows you how to use the new_message_callback to interact with the recorded audio after a keyword is spoken. It uses the speech recognition library in order to convert the recorded audio into text."

evancohen commented 5 years ago

You may want to check out Sonus, which does exactly what you describe.