c# - Microsoft Speech Platform 11(服务器)上的 AppendDictation?

标签 c# speech-recognition sapi speech-to-text

我对 C# 和 Microsoft Speech 平台都比较陌生,但我正在开发一个需要转录免费听写的服务器应用程序。 MS Speech Platform SDK 看起来很完美,并且可以在服务器上运行,除非我在 GrammarBuilder 中引用 AppendDictation() 方法。

我正在使用 Microsoft Speech Platform SDK 11,如果我定义语法,应用程序可以正常工作,但是当我添加 AppendDictation() 时,我遇到了这个错误:

Cannot find grammar referenced by this grammar.

即使文档中的这个示例似乎也失败了:

GrammarBuilder startStop = new GrammarBuilder();
GrammarBuilder dictation = new GrammarBuilder();
dictation.AppendDictation();

startStop.Append(new SemanticResultKey("StartDictation", new SemanticResultValue("Start Dictation",true)));
startStop.Append(new SemanticResultKey("DictationInput", dictation));
startStop.Append(new SemanticResultKey("StopDictation", new SemanticResultValue("Stop Dictation", false)));
Grammar grammar=new Grammar(startStop);
grammar.Enabled=true;
grammar.Name=" Free-Text Dictation ";
_recognizer.LoadGrammar(grammar);

奇怪的是,如果我将 LoadGrammar 更改为 LoadGrammarAsync,语法会加载(或至少调用事件处理程序),但 recoginzer 会失败并出现此错误:

Error: At least one grammar must be loaded before doing a recognition.

我读到该平台的服务器版本不支持听写,但奇怪的是它会附带一种行不通的方法。有没有人设法让听写语法在服务器上工作?我做错了什么?

非常感谢

最佳答案

对于将来可能遇到此问题的任何人——我现在已经与 Microsoft 来回发送电子邮件,并最终收到了以下回复:

The managed interfaces (Microsoft.Speech and System.Speech) are built on top of the native SAPI interfaces. These interfaces are the same for both the Server engine and the Desktop engine.

BUT the engine itself is responsible for implementing dictation, and the Server engine does not do so. Therefore, the call will fail when you load the grammar.

这不是我希望得到的答案,但它确实解释了这一点。

关于c# - Microsoft Speech Platform 11(服务器)上的 AppendDictation?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9347346/

相关文章:

c# - Windows 7 上的 log4net EventLogAppender 问题

c# - 使用非默认 AlgorithmIdentifier 解密 EnvelopedCms

javascript - 有没有一种方法可以针对给定的少量单词(大约100个单词)实现语音到文本的功能?

java - CMU Sphinx 转录准确性

c++ - 我可以在 Windows 7 上使用 SAPI 4 吗?

c# - 可以在 C# 中训练 sapi 吗?

c# - 自定义消息和默认消息

C# 数据库连接和datagridview

android - 使用哪种语音识别系统?

c# - SAPI 5.4 语法与 SAPI 5.1 兼容吗?