I am trying to make an Alexa skill where Alexa says something that has been marked up with SSML. I have tried to mimic the example in this repo, but I am always receiving a lambda response of
{
...
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "<speak> [object Object] </speak>"
},
...
}
and Alexa literally says "object object".
This is what I input to my lambda function (using node.js):
var speechOutput = {
type: "SSML",
ssml: 'This <break time=\"0.3s\" /> is not working',
};
this.emit(':tellWithCard', speechOutput, SKILL_NAME, "ya best not repeat after me.")
Setting speechOutput like this also isn't working:
var speechOutput = {
type: "SSML",
ssml: 'This <break time=\"0.3s\" /> is not working',
};
EDIT:
index.js
'use strict';
var Alexa = require('alexa-sdk');
var APP_ID = "MY_ID_HERE";
var SKILL_NAME = "MY_SKILL_NAME";
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context);
alexa.APP_ID = APP_ID;
alexa.registerHandlers(handlers);
alexa.execute();
};
var handlers = {
'LaunchRequest': function () {
this.emit('Speaketh');
},
'MyIntent': function () {
this.emit('Speaketh');
},
'Speaketh': function () {
var speechOutput = {
type: "SSML",
ssml: 'This <break time=\"0.3s\" /> is not working',
};
this.emit(':tellWithCard', speechOutput, SKILL_NAME, "some text here")
}
};
Anyone have any idea where I'm going wrong?