var Response = require('alexa-response');
//first intent
LaunchRequest:function(){
//Type 1 gives an error saying the "response is not valid" when tested in the developers console.
//the Response here is an npm library
Response.directives(
AudioPlayer.play({ url: 'https://s3.amazonaws.com/sounds226/boom.mp3' }),
AudioPlayer.enqueue({ url: 'https://s3.amazonaws.com/sounds226/boom.mp3' } ) .build();
//Type 2 : gives an error when tested on echosim.io saying that the response is not valid
speechOutput = this.t('WELCOME_MESSAGE'); this.response.audioPlayerPlay("REPLACE_ALL",audioData[1].url).speak(speechOutput);
this.emit(':responseReady');
//Type 3: tried to insert the audio tag within the speech response, error again
speechOutput = {
speech: "<speak>" +message+ "<audio src = 'https://s3.amazonaws.com/sounds226/boom.mp3'/></speak>",
type : 'SSML'
};
response.ask(speechOutput);
}
我想在alexa讲我的技能之前插入音频。音频在90秒内。这是我对音频标签错误理解的方式还是以错误的方式使用指令?先谢谢你。任何帮助表示赞赏Alexa-音频问题
约SSML - 请developer.amazon.com更严格地检查,例如在斯里克测试选项卡(!不AWS拉姆达测试) – nvvetal
是否启用音频播放器方向您亚马逊技能设置 –
是的,但要求做不需要音频指令。我试图弄清楚如何添加一个**音频样本**,在Alexa发言之前应该播放这个**音频样本,这与**音频指令**不相似。我通过'speechOutput = this.t('WELCOME_MESSAGE')+''实现了这一点';' – Meenashree