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

问题描述 投票:2回答:1

我正在尝试在自定义语音应用中使用直接语音(DLS)。语音应用程序可以访问我想要(直接进行pcm编码)的实时音频流,并将其直接转换为直接线语音,从而可以进行实时来回通信。

从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。我似乎找不到关于此的任何文档。有人可以阐明如何实现这一目标吗?

c# botframework direct-line-botframework
1个回答
2
投票

我相信您的答案属于Microsoft.CognitiveServices.Speech.Audio.AudioConfig类。在Direct Line Speech客户端中查看Microsoft.CognitiveServices.Speech.Audio.AudioConfig

this line

this.connector = new DialogServiceConnector(config, AudioConfig.FromDefaultMicrophoneInput()); 除了AudioConfig还提供了许多选项。我怀疑您将要使用三个FromDefaultMicrophoneInput重载之一。如果执行此操作,则FromStreamInput将使用您的流而不是麦克风。

© www.soinside.com 2019 - 2024. All rights reserved.