assistant-sdk-python
assistant-sdk-python copied to clipboard
Playing Sounds in Response to Events?
When using Google Assistant on your phone, there are several sounds that are played in response to certain events (after saying "Ok Google", etc.) - is there a nice way to get the sounds to play using the SDK?
I suppose one method would be to get the sound files from the search APK and use ALSA's "aplay" command as mentioned on the Assistant SDK website, but having these files included with the SDK would be nice.
You should be able to use the following package together to play sounds w/ the SDK: https://pypi.python.org/pypi/SoundFile https://pypi.python.org/pypi/sounddevice
@proppy That seems like a better way to handle playing the audio, but what about the Google sound files? Are these available for download anywhere, or would I have to extract them from the Google Assistant APK in order to play them?
They are not currently available for download with the SDK. Will keep this issue open to track the request
Could you please add audio feedback once wake word is recognised?
The default google-assistant-demo
running in headless mode at the moment does not have any feedback and user is clueless whether it listening or not
Yes, please, make tutorial how to add any sound feedback, then Google Assistant hears hotword.
Maybe someone is already created some python script for that?
I'm interested too. Right now you dont know if GA is listening before you ask your question which makes it frustrating when you have to wait for some time to realise.
It's pretty easy to implement this yourself.
(pip install playsound
and change the sound file to something if you follow the example)
Are the Google hotword dings available for download?
@skogsmaskin playsound literally breaks the assistant.
You may be able to find the raw sound files somewhere online, although I don't think we have them available for download.
Well, in new Google-Assistant SDK I can't get any playback from @skogsmaskin tutorial. Somone know where should I put my subprocess.call function now?
Pygame did the job for me...
pygame.mixer.init()
pygame.mixer.music.load('/home/mantha/Downloads/ding.mp3')
if event.type == EventType.ON_CONVERSATION_TURN_STARTED:
print()
pygame.mixer.music.play()
print(event)
And, I needed a google ding so it's not assuring but does the job Zedge