【发布时间】:2017-08-11 21:41:58
【问题描述】:
我已将语音输入 api (Bing Speech API) 集成到我正在开发的一个 BOT(MS BOT 框架-.net)中,但不确定如何测试它是否正常工作。 MS Bot 模拟器是否有助于使用麦克风对其进行测试?还是我应该使用Skype之类的任何频道来测试它? 请帮忙。
谢谢
【问题讨论】:
标签: speech-recognition speech-to-text botframework
我已将语音输入 api (Bing Speech API) 集成到我正在开发的一个 BOT(MS BOT 框架-.net)中,但不确定如何测试它是否正常工作。 MS Bot 模拟器是否有助于使用麦克风对其进行测试?还是我应该使用Skype之类的任何频道来测试它? 请帮忙。
谢谢
【问题讨论】:
标签: speech-recognition speech-to-text botframework
我使用https://docs.botframework.com/en-us/skype/calling/#calling-conversation-object-model 中定义的录制操作创建了一个 Skype 机器人来录制用户的音频,然后在使用声音文件完成录制后使用 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);
【讨论】: