我正在研究一种Alexa技能,该技能在使用ASK CLI ask dialog
运行时效果很好,但是当我尝试在echo dot或echosim.io上进行测试时,该技能启动了,但是没有响应任何输入。我什至不能说“ Alexa停止”或“ Alexa取消”。模拟器中所有无法正常使用的输入。最终,该技能将提示我,然后它会发出一些蜂鸣声而出错。没有创建cloudwatch日志(尽管由于播放了启动响应,启动请求似乎成功了)。
这是我的启动请求处理程序:
const sound = require('../utils/sound');
const getUserFromHandler = require('../queries/getUserFromHandler');
module.exports = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
async handle(handlerInput) {
const { wordIndex } = await getUserFromHandler(handlerInput);
const welcomeMessage = `
Welcome to skill name.
${wordIndex > 0 ? `You have learned ${wordIndex} word${wordIndex > 1 ? 's' : ''} so far, Good Job!` : ''}
${sound('choose-path-english')}
`;
return handlerInput.responseBuilder
.speak(welcomeMessage)
.reprompt(sound('choose-path-english'))
.withSimpleCard('Welcome to skill name', 'Say "new word", "review", or "repeat word"')
.getResponse();
},
};
消息“欢迎使用技能名称”和音频文件“ choose-path-english”均按预期方式播放,但是无论我说什么,回声点都挂着等待响应。
为什么会这样?