Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Playing Sounds in Response to Events? #11

Open
ryan-clancy opened this issue May 3, 2017 · 12 comments
Open

Playing Sounds in Response to Events? #11

ryan-clancy opened this issue May 3, 2017 · 12 comments
Labels
enhancement sample Related to the sample code

Comments

@ryan-clancy
Copy link
Contributor

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.

@proppy
Copy link
Contributor

proppy commented May 3, 2017

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

@ryan-clancy
Copy link
Contributor Author

ryan-clancy commented May 3, 2017

@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?

@alfongj
Copy link

alfongj commented May 14, 2017

They are not currently available for download with the SDK. Will keep this issue open to track the request

@palaniraja
Copy link

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

@Kalvisan
Copy link

Kalvisan commented Jun 9, 2017

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?

@idimitrakopoulos
Copy link

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.

@skogsmaskin
Copy link

skogsmaskin commented Jan 19, 2018

It's pretty easy to implement this yourself.

(pip install playsound and change the sound file to something if you follow the example)

@viggy96
Copy link

viggy96 commented Apr 6, 2018

Are the Google hotword dings available for download?

@viggy96
Copy link

viggy96 commented Apr 6, 2018

@skogsmaskin playsound literally breaks the assistant.

@Fleker
Copy link
Contributor

Fleker commented Apr 6, 2018

You may be able to find the raw sound files somewhere online, although I don't think we have them available for download.

@Kalvisan
Copy link

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?

@Fleker Fleker added the sample Related to the sample code label Sep 15, 2018
@mstech66
Copy link

mstech66 commented Nov 21, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement sample Related to the sample code
Projects
None yet
Development

No branches or pull requests

10 participants