【发布时间】:2017-10-06 06:57:00
【问题描述】:
我正在尝试在我的 Alexa Skill 中使用 SSML。我使用 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));
}
我认为我在回调中犯了一个错误?提前致谢!
【问题讨论】:
标签: java aws-lambda alexa-skills-kit