简体   繁体   English

如何使用 Google Actions Dialogflow 播放实时音频 stream

[英]How to play live audio stream using Google Actions Dialogflow

I have been trying to find a way to play live stream of audio (mp3) using Google Actions but haven't found a way to do so.我一直在尝试找到一种方法来使用 Google Actions 播放音频 (mp3) 的实时 stream,但还没有找到这样做的方法。

I tried Media Response as well but as mentioned in the documentation it doesn't support live stream.我也尝试了媒体响应,但如文档中所述,它不支持实时 stream。

I followed this thread but it doesn't have any examples to help me with.我关注了这个线程,但它没有任何示例可以帮助我。

Is it possible to play live mp3 stream using Google Actions?是否可以使用 Google Actions 播放实时 mp3 stream?

I've had relatively good results with the Media Player being able to handle mp3 "streams".媒体播放器能够处理 mp3“流”,我取得了相对较好的结果。 There are a couple of problems doing this, however:但是,这样做有几个问题:

  • There is a time limit on the audio playback (4 hours last time I checked, but it may have changed).音频播放有时间限制(我上次检查时是 4 小时,但可能已经改变)。
  • There isn't any such thing as an mp3 "stream".没有任何诸如mp3“流”之类的东西。 The player treats it as a single mp3 file that it downloads in chunks using HTTP headers, unlike some of the streaming protocols that allow for varying bitrate based on network and other conditions.播放器将其视为单个 mp3 文件,它使用 HTTP 标头以块的形式下载,这与某些允许根据网络和其他条件改变比特率的流协议不同。

If this is an issue, one alternative might be to use the Interactive Canvas (which uses Chrome on the device) to present an HTML page that has an <audio> tag in it that you control.如果这是一个问题,一种替代方法可能是使用交互式 Canvas(在设备上使用 Chrome)呈现一个 HTML 页面,其中包含您控制的<audio>标签。 This gives you a little more control (most streaming protocols are either supported or have JavaScript libraries that can do the work), but there are some downsides:这为您提供了更多控制权(大多数流协议要么受支持,要么具有可以完成工作的 JavaScript 库),但也有一些缺点:

  • This will only work on Smart Displays and Android.这仅适用于智能显示器和 Android。 Smart Speakers aren't supported.不支持智能扬声器。
  • Interactive Canvas is only allowed for certain types of Actions.交互式 Canvas 仅允许用于某些类型的操作。 Currently it must be a game, a story, or an educational Action.目前它必须是游戏、故事或教育动作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用对话流实现 node.js 在谷歌操作上实现二叉决策树? - How to implement a binary decision tree on google actions using dialogflow fulfillment node.js? 如何以低延迟流媒体直播音频 - How to Stream Live Audio With Low Latency 如何在星号中获取实时音频流 - How to get a live audio stream in asterisk Dialogflow webhook(Google上的操作)。 是否应该使用RichResponse? - Dialogflow webhook (Actions on Google). Should I be using RichResponse or not? 在dialogflow的WebhookClient中使用Google上的轮播或列表操作时出错 - Error using actions-on-google Carousel or List with dialogflow's WebhookClient 使用 Google 上的操作 SDK 获取 Dialogflow webhook 路径参数 - Getting Dialogflow webhook path parameters using Actions On Google SDK Google上的操作不起作用,但它们在dialogflow中起作用 - actions on google not working but they does in dialogflow 关于dialogflow的意图不会在Google的操作上更新 - Intents on dialogflow not updating on actions on google 如何使用hapi Node.js框架对Google动作对话框进行整数运算? - How to integerate Google actions dialogflow with hapi nodejs framework? 如何使用字段和变量在带有Dialogflow的Google Actions中永久保存数据? - How to use fields and variables to save data permanently in Google Actions with Dialogflow?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM