0

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.

Harmonic
  • 367
  • 1
  • 3
  • 18
  • If you're using snowboy for hotword detection, then is there a reason you're using the library as opposed to the service API? – Nick Felker Feb 24 '18 at 08:20
  • From what I saw, the API was only for training - which I don't need. Plus, getting the detection working with their library was super easy. The problem is that when using their detection to `start_conversation()`, `process_event` no longer works. If you think that using their API instead of using local hotword detection would be advantageous, please give a brief explanation on why and I'll take a look. – Harmonic Feb 24 '18 at 15:09
  • I was referring to the two developer platforms for the Google Assistant SDK. The Google Assistant library (`hotword.py`) includes hotword detection by default. The Google Assistant Service API (`pushtotalk.py`) uses a set of RPC calls to send and receive data. – Nick Felker Feb 24 '18 at 21:22
  • Thanks for the info. I'll take another look at pushtotalk and see if that is more in line with what I need. If so, I'll request that you post it as an answer and I'll mark it as correct. – Harmonic Feb 25 '18 at 19:33

0 Answers0