9

I followed the steps to create a sample app and it is doing perfect conversation with my custom agent created.

Can we play our own music or MP3 hosted in my server by a voice message to Google Home? Or I need to play an audio from my Android app that is installed in Android device which is paired with Google Home by sending voice message to it?

unor
  • 92,415
  • 26
  • 211
  • 360
Arshad
  • 945
  • 9
  • 11

1 Answers1

1

You can play audio files using the <speak>This is the audio <audio>link/or/url/to/audiofile.mp3</audio></speak> in your string response. You can find more details in the SSML section

Nazeem
  • 468
  • 2
  • 9
  • 1
    It's worth noting that if using a DNS address (as opposed to IP address), you need to use a globally-resolvable DNS record. (I.e. not something defined on your local DNS server) Devices like the Chromecast (and, I presume, Google Home) appear to ignore DHCP-provided DNS servers in favor of some hardcoded DNS server. – Michael Mol Apr 06 '17 at 17:05
  • I'm sorry, I don't follow! – Nazeem Apr 06 '17 at 23:38
  • 1
    So, `link/or/URL/to/audio file.mp3` might be something like `http://192.168.7.9/my.file.mp3` or `http://my.home.server.com/my.file.mp3`. Both are fine. However, for the latter to work, `my.home.server.com` needs to exist in the *global* DNS somewhere. It's not enough to create a static DNS entry on your home router, as Google Home devices (if they operate the same way as Chromecasts) don't ask your home router to resolve DNS for them, but instead ask Google's DNS servers; they do this even if your home DHCP server instructs clients to use your home router for DNS resolution. – Michael Mol Apr 08 '17 at 19:20