Skip to content Skip to sidebar Skip to footer

How Can I Get An Led To Light On Google Assistant Listening?

After a long research without any results, I'm trying my luck here. I recently got the GA SDK sample to work on my Raspberry Pi 3. Now I would like to light my connected LED when t

Solution 1:

Look at the hotword sample here https://github.com/googlesamples/assistant-sdk-python/blob/master/google-assistant-sdk/googlesamples/assistant/library/hotword.py

You can use the events to write your GPIO logic to turn on/off the LED. Something like this -

`defprocess_event(event):
    if event.type == EventType.ON_CONVERSATION_TURN_STARTED:
        print()
        GPIO.output(25,True)
    if (event.type == EventType.ON_CONVERSATION_TURN_FINISHED and
            event.args andnot event.args['with_follow_on_turn']):
        print()
        GPIO.output(25,False)
    if (event.type == EventType.ON_RECOGNIZING_SPEECH_FINISHED and
            event.args andnot event.args['with_follow_on_turn']):
        print()`

here's the documentation on the library- https://developers.google.com/assistant/sdk/reference/library/python/

Post a Comment for "How Can I Get An Led To Light On Google Assistant Listening?"