question

Aditya-Kumar-Roy avatar image
Aditya-Kumar-Roy asked ·

How to send multiple URLs in play() for audio skills.

Hi, So for the audio().play() method, we send one accessible HTTP(S) endpoint containing the audio we want the app to play. However, for me, I want to append another short audio(available from a URL) to each of my present audio and serve it to the user, so that both the audio contents play one after the another.

I have little scope to pre-merge them and serve a single URL audio content, and I can't mix the audio on the fly owing to timeout. Being able to serve two URLs at the same time, expecting they will play one after the other is more likely to solve my case.

alexa skills kithow-toaudioaudioplayer
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rajeev avatar image
Rajeev answered ·

I don't think so you can send multiple URLs in play. But alexa sends AudioPlayer.playbacknearlyfinished request when the first track is about to finish than u have to send response with the second track URL, which will be played after first song ends.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

meep avatar image
meep answered ·

You could try adding both audio URLS to a .m3u text file. Alexa supports playback of .m3u files which are essentially playlists.Some people have reported problems with the format but they've worked great for me.

As an added bonus, you can use http urls for your audio inside the M3U file and, provided the file itself is served from a https server, it's a way to playback http streams as well.

What's really cool about this approach is that you can dynamically generate the m3u and send a different one for each user if necessary.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Moose@Amazon avatar image
Moose@Amazon answered ·

Hi

Are you asking ASK question or AVS question? If you are asking ASK question, you should post here.

For AVS, when your client is ready to buffer/download the next stream in your playback queue, you can send PlaybackNearlyFinished event, and Alexa will respond to this event and send Play directive containing the next stream info.

Let me know if this help.

Moose

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.