alexa-samples / skill-sample-nodejs-audio-player

An Alexa Skill Sample showing how to play long form audio in 3P-skills
Other
470 stars 319 forks source link

After saying Next, audio player will not continue after next audio ,please help #115

Closed ranjithavav closed 6 years ago

ranjithavav commented 6 years ago

Team, next is working and it streams next audio but after that it stops.

And also resume command not accepting , saying "this is not a valid command'

kindly help me anyone

sebsto commented 6 years ago

Hello, Thank you for trying out our sample code. Which skill are you reporting this for ? The Multiple Stream or Single Stream ? Are you using the code "as is" or did you do any modification ? If you did modify the code, can you share your changes or the git repo with the updated code so that we can have a look ? In general, any more details that will help us to understand the root cause of the problem will be appreciated. Cheers

ranjithavav commented 6 years ago

Thanks for your comments, Issue is for multi stream and I am using same code only . If we are playing with say next command it's playing continuosly ,but if we says next it's play next then stops play.

sebsto commented 6 years ago

Thank you for the details - I will have a look and report back

allthepies commented 6 years ago

There's a bug around the resetting of the nextStreamEnqueued flag.

If an audio track is stopped via a "next", "previous" etc voice command then the nextStreamEnqueued flag isn't reset and when the next PlaybackNearlyFinished event occurs then the event handler checks the flag, sees it's still set and exits the handler without enqueuing the next track.

Change the play function in the controller object as follows

// Existing code
const playBehavior = 'REPLACE_ALL';
const podcast = constants.audioData[playOrder[index]];
const token = playOrder[index];

// Add the following line
playbackInfo.nextStreamEnqueued = false;
ananddevsingh commented 6 years ago

@allthepies , @sebsto . Thank you so much. I confirm, the issue is fixed now.

sebsto commented 6 years ago

Thank you for the fix. Merged now