我正在嘗試在我的Alexa技能中使用SSML。我使用Lambda作爲服務端點,並使用Js對其進行編程。現在我的問題是,我如何在我的技能中正確實施?我使用下面的函數使用SSML:如何在Alexa技巧+ Lambda + Js中使用SSML
function buildSSMLSpeechletResponse(title, output, repromptText, shouldEndSession) {
return {
outputSpeech: {
type: "SSML",
ssml: output
},
card: {
type: "Simple",
title: "SessionSpeechlet - " + title,
content: "SessionSpeechlet - " + output
},
reprompt: {
outputSpeech: {
type: "SSML",
text: repromptText
}
},
shouldEndSession: shouldEndSession
};
}
我的代碼:
function onLaunch(launchRequest, session, callback) {
console.log("onLaunch requestId=" + launchRequest.requestId
+ ", sessionId=" + session.sessionId);
var cardTitle = "Hello, World!";
var speechOutput = { type: "SSML",
ssml: "<speak>Welcome to Hubo help. <amazon:effect name='whispered'>You can ask questions like</amazon:effect>: 'How do I paint a wall?'. Now what can I help you with?.</speak>", };
callback(session.attributes,
buildSSMLSpeechletResponse(cardTitle, speechOutput, "", true));
}
我想我在回調的錯誤呢?提前致謝!