Friends,
I'm working on an Alexa skill that attempts to stream an mp3 file from a publicly accessible S3 bucket. My lambda function is working correctly, and returns an audio directive. I'm using the npm package alexa-sdk.
However when the response is sent back to the Echo device, I'm getting a generic error of "there was an error with your skills response." I Googled for some type of Alexa response lintet to try and validate my response object.
Below is my lambda function IntentHandler, and the response object being returned from said function. Can someone take a look and point out any errors they see? It's much appreciated.
var handlers = {
'LaunchRequest': function () {
this.emit(':tell', 'Hello');
},
GetVoiceMailIntent: function(){
this.response.audioPlayerPlay('REPLACE_ALL', 'https://s3.amazonaws.com/romevm/call_1001.mp3', 'vmtoken', 0);
this.emit(':responseReady');
},
SessionEndedRequest: function () {
console.log('session ended!');
}
} //end intent handlers
*********** RESPONSE **************
{
"version": "1.0",
"response": {
"speechletResponse": {
"directives": [
{
"playBehavior": "REPLACE_ALL",
"audioItem": {
"stream": {
"expectedPreviousToken": "0",
"token": "vmtoken",
"url": "https://s3.amazonaws.com/romevm/call_1001.mp3",
"offsetInMilliseconds": 0
}
}
}
],
"shouldEndSession": true
}
},"sessionAttributes": {}
}