alexa - 无法在音频播放结束时添加 .listen() 指令
问题描述
就上下文而言,我正在构建一种将录制的旁白作为音频流的技能。
- 对于其中一个旁白,将向用户提出一个问题(记录为旁白的一部分)
- 使用 捕获的用户意图
this.response.listen()
将决定下一组要播放的旁白
我的问题如下 - 作为技能的一部分需要音频播放,我使用的是AudioPlayerInterfaces
. 我在以下部分遇到错误(请参见下面的代码和注释):
var audioEventHandlers = {
'PlaybackStarted': function() {
this.emit(':responseReady');
},
'PlaybackFinished': function() {
if (currentStream.keyName === 'intro') {
this.response.listen(); //<-- this line causes the error
}
this.emit(':responseReady');
}, //additional handler code omitted as not relevant
具体来说,触发的错误this.response.listen()
是:
"error": {
"type": "INVALID_RESPONSE",
"message": "The following directives are not supported: Response may not contain an reprompt,Response may not have shouldEndSession set to false"
},
我看过其他技能使用录音,然后是.listen()
提示,所以我知道这在技术上是可行的。我想知道我应该如何处理这个问题?
谢谢!
解决方案
推荐阅读
- firebase - 将应用程序迁移到 Android X for Firebase Crashlytics,在 7.1.1 (SDK 25) 上停止安装
- .net - 如何从 Azure 应用程序网关后面的我的 Wordpress 博客中获取所有内容以定向到正确的服务?
- django - 通过 HTTP 请求调用 Django 视图比通过 Django shell 调用时慢得多
- java - Xamarin.Android 支持 GithubActions 工作流?(或如何以编程方式安装 JDK)
- jquery - Slick Slider - 在滑块初始化之前隐藏其他幻灯片
- model-view-controller - 当我添加到新表 MVC 5 时使用 SendGrid 发送电子邮件
- asp.net-core - 将 Azure AD 电子邮件记录到 ASP.NET 身份表中
- c++ - 如何在遍历向量时分配变量?
- c# - 尝试通过可视化代码托管静态站点,但构建后出现错误
- python - 从 Google Cloud Function python3.7 连接到 Google Cloud SQL