如何实现自动滚动的Alexa APL语音/文本同步?

问题描述

显示文本较大时,我正在尝试为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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...