I am attempting to write an Alexa skill that simply plays an MP3 file. I modified the default "hello world" lambda with this code:
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest';
},
handle(handlerInput) {
return {
"response": {
"directives": [
{
"type": "AudioPlayer.Play",
"playBehavior": "REPLACE_ALL",
"audioItem": {
"stream": {
"token": "12345",
"url": "https://jpc.io/r/brown_noise.mp3",
"offsetInMilliseconds": 0
}
}
}
],
"shouldEndSession": true
}
}
}
};
exports.handler = Alexa.SkillBuilders.custom()
.addRequestHandlers(
LaunchRequestHandler,
)
.lambda();
But when I deploy the code and invoke the skill, it doesn't make any sound or report any error. When I replace the handle
code with
const speakOutput = 'Hello world';
return handlerInput.responseBuilder
.speak(speakOutput)
.reprompt(speakOutput)
.getResponse();
then she says hello world when invoked.
My question: why will she speak words to me, but not seem to play my mp3? I've seen other questions on stack overflow where the cause was that they weren't using https, but I am using https.