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