alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

audioPlayerPlay does not allow chaining play directives #24

Closed scottbouma closed 7 years ago

scottbouma commented 7 years ago

I'd like to queue up multiple audio streams, as per the directives array discussed in the API docs here:
https://developer.amazon.com/public/community/post/Tx1DSINBM8LUNHY/New-Alexa-Skills-Kit-ASK-Feature-Audio-Streaming-in-Alexa-Skills

The natural way seems to be to make multiple calls to audioPlayerPlay. Unfortunately that method just overwrites the directive array every time instead of pushing new items. It would be nice if that method would support multiple calls.

KrishFuriaAmazon commented 7 years ago

Making multiple calls is currently not supposed by the API. But you can look in this sample how "PlaybackNearlyFinished" is implemented to solve your purpose.

For more information checkout "Handling AudioPlayer Requests" section of the API Docs.