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 737 forks source link

AudioPlayer events #590

Closed benrolfe closed 4 years ago

benrolfe commented 4 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

In development & production I'm not receiving any AudioPlayer events. I'm expecting to receive AudioPlayer.PlaybackStopped when the audio is stopped.

When the user says "Resume", I want to resume from where they paused or stopped. How do I know where they stopped listening?

Expected Behavior

AudioPlayer.PlaybackStopped event fires when the audio is stopped.

Current Behavior

I never receive a request type of AudioPlayer.PlaybackStopped

Steps to Reproduce (for bugs)

Listen for AudioPlayer.PlaybackStopped

Context

I want to know when the audio was stopped. Otherwise how do I know where to resume the audio from?

Your Environment

Node.js and NPM Info

nikhilym commented 4 years ago

Hey @benrolfe , I tried to reproduce this in the official multistream audioplayer sample. Whenever I trigger the "stop" utterance, the skill is receiving the PauseIntent and the skill is returning an AudioPlayer.Stop directive. After that, the skill is receiving the AudioPlayer.PlaybackStopped request with the offset information where the playback was stopped. You can use this information to figure out where to resume the audio.

Please look at the example skill to see how you can use persistence attributes to store this information and resume the audio from the skill. Hope this helps.

Please reopen the issue if you still have any problems.