You have to send an AudioPlayer.Stop
directive to stop any currently playing audio stream.
'AMAZON.CancelIntent': function() {
this.response.speak('Bye').audioPlayerStop();
this.emit(':responseReady');
}
In ask-sdk-v2 you can use:
return handlerInput.responseBuilder
.addAudioPlayerStopDirective()
.getResponse();
Update
Alexa service will track your audio player skill as the skill that most recently streamed audio and for any built in intent, Alexa will create a new session and trigger the request to your skill.
When your skill sends a Play directive to begin playback, the Alexa service sends the audio stream to the device for playback.
Once the session ends normally (for instance, if your response
included the shouldEndSession flag set to true), Alexa remembers that
your skill started the playback until the user does one of the
following:
- Invokes audio playback with a different skill.
- Invokes another service that streams audio, such as the built-in music service or the flash briefing.
- Reboots the device.
Check this documentation Built-in Intents for Playback Control
More on AudioPlayer directives here