如何在同一个 Alexa 意图函数中添加两个以上的音频(标签)文件?



嗨,我正在尝试在我的 Alexa 技能中使用两个以上的音频标签,并且根据 Alexa 的要求编辑音频,现在音频不超过 250 秒 我想让 Alexa 说出音频 我有五个音频文件,所以五个音频标签,所以我怎样才能让 Alexa 连续说出 5 个音频标签 我已经重命名了网站链接。由于某种原因,顺便说一下,网站链接运行良好

const Thiriller = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'IntentRequest'
&& Alexa.getIntentName(handlerInput.requestEnvelope) === 'Thiriller';
},
handle(handlerInput) {
var audio = "<audio src='https://lul.com/wp-content/uploads/2019/Flight%20PT1.mp3?_t=1567452928'/>";
var audio1 = "<audio src='https://lul.com/wp-content/uploads/2019/Flight%20Pt2.mp3?_t=1567452928'/>";   
return handlerInput.responseBuilder
.speak(audio)
.speak(audio1)
//.reprompt('add a reprompt if you want to keep the session open for the user to respond')
.getResponse();
}

};

试试这个。

return handlerInput.responseBuilder
.speak(audio + audio1)
//.reprompt('add a reprompt if you want to keep the session open for the user to respond')
.getResponse();

如果您需要 5 个背靠背 .speak(音频 + 音频1 + 音频2 + 音频3(

只需确保总持续时间不超过 SSML 音频限制(即 240 秒(。

最新更新