speech-recognition - 如何在 Microsoft BOT 中测试语音输入?

标签 speech-recognition speech-to-text botframework

我已将语音输入 api(Bing Speech API)集成到我正在开发的其中一个 BOT(MS BOT 框架-.net)中,但不确定如何测试它是否正常工作。 MS Bot 模拟器是否有助于使用麦克风对其进行测试?或者我应该使用像Skype这样的任何 channel 来测试它吗?
请帮忙。

谢谢

最佳答案

我使用 https://docs.botframework.com/en-us/skype/calling/#calling-conversation-object-model 中定义的记录操作创建了一个 Skype 机器人。录制来自用户的音频,然后在使用 soundfile 完成录制后使用 Bing 语音识别 API 执行语音到文本。

      private async Task OnRecordCompleted(RecordOutcomeEvent recordOutcomeEvent)
    {      
      string s = string.Empty;
                 string path = string.Empty;
                  if (recordOutcomeEvent.RecordOutcome.Outcome = Outcome.Success)
                 {
                      var record = await recordOutcomeEvent.RecordedContent;
            path =               HttpContext.Current.Server.MapPath($"~/{recordOutcomeEvent.RecordOutcome.Id}.wav");
            using (var writer = new FileStream(path, FileMode.Create))
            {
                await record.CopyToAsync(writer);
            }
            Attachment att = new Attachment()
            {
                ContentUrl = "file:///" + path,
                ContentType = "audio/wav",

            };
            s = DoSpeechReco(att);

关于speech-recognition - 如何在 Microsoft BOT 中测试语音输入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38607871/

相关文章:

ipad - 从哪里开始开发语音识别应用程序

android - 离线语音识别 android 获取不需要的语音

c# - Microsoft bot 服务在本地运行良好,但在网络聊天 channel 中运行不佳

c++ - 在 Mac 上安装 Kaldi

android - 为什么它在开始监听之前不休眠 3 秒?

java - getComponentNames 没有这样的方法错误

ibm-cloud - 如何提高 Watson Speech to Text 的准确性?

react-native - React Native 录制视频并捕获语音到文本

c# - 在 C# 机器人框架中创建循环

azure - 仅通知 Teams 机器人的服务 URL