问题描述
当显示文本较大时,我正在尝试为Alexa Echo节目实现自动滚动功能。我正在将Alexa ASK SDK用于Node.js. 我正在关注此文档:https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-speech-and-text-synchronization-for-text-blocks.html
这是我的代码,
伪代码:APL_document.json
"items": [
{
"type": "Container","height": "100vh","width": "100vw","items": [
{
"type": "ScrollView","height": "100%","width": "100%","item": {
"type": "Text","id": "catFactText","text": "${catFactData.properties.catFact}","speech": "${catFactData.properties.catFactSpeech}"
}
}
]
}
]
data.json
{
"datasources": {
"catFactData": {
"type": "object","properties": {
"backgroundImage": "https://.../catfacts.png","title": "Cat Fact #9","logoUrl": "https://.../logo.png","image": "https://.../catfact9.png","catFactSsml": "<speak>Not all cats like <emphasis level='strong'>catnip</emphasis>.</speak>"
},"transformers": [{
"inputPath": "catFactSsml","outputName": "catFactSpeech","transformer": "ssmlToSpeech"
},{
"inputPath": "catFactSsml","outputName": "catFact","transformer": "ssmlToText"
}
]
}
}
}
意图处理程序:
handle(handlerInput) {
return handlerInput.responseBuilder
.addDirective({
type : 'Alexa.Presentation.APL.RenderDocument',token :'documentToken',document : require('./templates/APL_document.json'),datasources: require('./data/data.json')
})
.addDirective({
type : 'Alexa.Presentation.APL.ExecuteCommands',token: 'documentToken',commands: [
{
"type": "SpeakList","componentId": "catFactText"
}
]
})
.getResponse();
}
现在的问题是Alexa Echo Show没有响应,什么也没看到。我这是怎么了?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)