c# - 如何将实时音频流传递到 Direct Line Speech 端点?

标签 c# botframework direct-line-botframework

我正在尝试在我的自定义语音应用程序中使用 Direct Line Speech (DLS)。语音应用程序可以访问实时音频流,我希望将其直接(pcm 编码)到 Direct Line Speech,从而允许实时来回通信。

从 DLS 客户端示例代码 ( https://github.com/Azure-Samples/Cognitive-Services-Direct-Line-Speech-Client ) 中,我看到 Microsoft.CognitiveServices.Speech.Dialog.DialogServiceConnector 命名空间中的 ListenOneAsync() 方法,但看起来它正在从本地麦克风捕获媒体。

但是看这里的回复(Is new ms botbuilder directline speech good fit for call center scenario?),看来我可以直接将音频流发送到DLS。我似乎找不到与此相关的任何文档。有人可以阐明如何实现这一目标吗?

最佳答案

我相信你的答案就在 Microsoft.CognitiveServices.Speech.Audio.AudioConfig类(class)。看看this line在 Direct Line Speech 客户端中:

this.connector = new DialogServiceConnector(config, AudioConfig.FromDefaultMicrophoneInput());

AudioConfig 除了 FromDefaultMicrophoneInput 之外还提供了许多选项。我怀疑您会想使用三个 FromStreamInput 之一过载。如果您这样做,ListenOnceAsync 将使用您的流而不是麦克风。

关于c# - 如何将实时音频流传递到 Direct Line Speech 端点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58212779/

相关文章:

c# - botframeworkv4 - 可用 channel ID 列表

azure - 除了使用登录卡之外,还有其他方法在机器人中登录用户吗?

node.js - 我可以在本地托管 MS Bot Framework Node.js 实例吗

node.js - 如何在 Bot Framework Node.js 网络聊天中隐藏直接 secret 并传递 token

C# 将字符串编码结构发送至 C 库

c# - MVC Controller 冒泡回到路由器?

c# - ASP.NET MVC : How to obtain assembly information from HtmlHelper instance?

更改图像时 C# 图片框位置更改

botframework - 如何从单独的瀑布对话框中取消所有对话框

c# - 如何使用机器人框架向新 channel 发送消息?