我正在尝试在我的Alexa技能中使用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));
}我想我在回拨的时候搞错了?提前感谢!
发布于 2017-05-08 20:37:39
如果您使用的是Alexa Skills Kit SDK for Node.js,那么只需在要发出的文本中包含SSML标记即可。
例如:
this.emit(':tell', 'Sometimes when I look at the Alexa skills you have all taught me, I just have to say, <say-as interpret-as="interjection">Bazinga.</say-as><break time="0.3s"/><amazon:effect name="whispered"> I love it. </amazon:effect>')
this.emit(':tell', '<say-as interpret-as="interjection">Oh boy</say-as><break time="1s"/> this is just an example.')
它将包含在README.md文件中,现在已经有了this PR
https://stackoverflow.com/questions/43844826
复制相似问题