Я пытаюсь выработать навык Alexa, где Alexa говорит что-то, что было размечено с помощью SSML. Я попытался имитировать пример в этом репо, но я всегда получаю лямбда-ответ
{
...
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "<speak> [object Object] </speak>"
},
...
}
А Алекса буквально говорит «объект-объект».
Вот что я ввожу в свою лямбда-функцию (используя 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.")
Настройка SpeechOutput, подобная этой, также не работает:
var speechOutput = {
type: "SSML",
ssml: 'This <break time=\"0.3s\" /> is not working',
};
РЕДАКТИРОВАТЬ:
index.js
'использовать строго';
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")
}
};
Кто-нибудь знает, в чем я ошибаюсь?