So, using the googlesamples-assistant-hotword
hotword.py
example, I am able to get Google Assistant running on Ubuntu.
Using ON_RECOGNIZING_SPEECH_FINISHED
, I'm able to grab the speech and either deal with it locally or continue to send it to Google for processing. Something simple like this:
if myText == "shutdown":
assistant.stop_conversation()
os.system('shutdown')
So far this is all working as I want, but *I do have two follow up questions to this section that I will ask later.
What I wanted was to use a custom Hotword to initiate a conversation with Google Assistant, so I used Snowboy to achieve this.
By using ON_START_FINISHED
, I am able to start up snowboy detection for my custom hotword, and in the detected_callback
function, I use start_conversation()
to activate assistant. This does work, as in I can now speak and Assistant will respond, but when using snowboy, all of my process_event
events no longer trigger. So, my custom commands will no longer work.
Does anyone have any idea on how I can rectify this?
BONUS: It would be nice to get Assistant to "speak" a custom sentence when I need it to. For example, if I tell it to "shutdown" like in the above example, it would be cool to have it reply "Goodbye" or something.