question

Artur Pessoa avatar image
Artur Pessoa asked

You just triggered AMAZON.ResumeIntent when trying to resume Audioplayer Content

I'm creating a alexa skill with a audio and video response. The video one works fine, but everytime I try resuming an audio file, I get the same "You just triggered AMAZON.ResumeIntent" response no matter what change I make

intentsaudioplayeralexa skills
10 |5000

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

Andy Whitworth avatar image
Andy Whitworth answered

Sounds like you don't have a handler for the "AMAZON.ResumeIntent" intent in your code and the default handler is being executed. If you do have that intent handler then perhaps you've not included it in the

Alexa.SkillBuilders.custom().addRequestHandlers()

request handler (usually at the bottom of the index.js file assuming you're using node)

10 |5000

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

Artur Pessoa avatar image
Artur Pessoa answered

Hi there, I've already created a handler for the intent, and its working on video device, here is the handler


const ResumeIntentHandler = {
async canHandle(handlerInput) {
const playbackInfo = await getPlaybackInfo(handlerInput);

return (
playbackInfo.inPlaybackSession &&
Alexa.getRequestType(handlerInput.requestEnvelope) === "IntentRequest" &&
(Alexa.getIntentName(handlerInput.requestEnvelope) ===
"AMAZON.PlayIntent" ||
Alexa.getIntentName(handlerInput.requestEnvelope) ===
"AMAZON.ResumeIntent")
);
},
async handle(handlerInput) {
if (util.supportsAPL(handlerInput)) {
return handlerInput.responseBuilder
.addDirective(require('./apl/execute-play')())
.getResponse();
} else {
const playbackInfo = await getPlaybackInfo(handlerInput);
const playBehavior = 'REPLACE_ALL';


if (isKids === true) {
const podcastUrl ='/kids/musics/EP' + epCounter + '.mp3';
const speakOutput = 'Resumindo ';

return handlerInput.responseBuilder
.speak(speakOutput)
.addAudioPlayerPlayDirective(
playBehavior,
podcastUrl,
playbackInfo.token,
playbackInfo.offsetInMilliseconds
)
.getResponse();
}


if (isEntertaiment === true) {
const podcastUrl ='/entertainment/musics/EP' + epCounter + '.mp3';

const speakOutput = 'Resumindo ';
return handlerInput.responseBuilder
.speak(speakOutput)
.addAudioPlayerPlayDirective(
playBehavior,
podcastUrl,
playbackInfo.token,
playbackInfo.offsetInMilliseconds
)
.getResponse();
}

}
}
};
1 comment
10 |5000

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

OK, I would add some debug console.log() statements all in that handler. Both in the canHandle function and the handle() function itself. Check things like the playbackInfo.inPlaybackSession value.

0 Likes 0 ·