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 秒内。是我理解音频标签的方式错误还是以错误的方式使用指令?先感谢您。任何帮助表示赞赏