【问题标题】:Speech Recognition PlatformNotSupportedException语音识别平台NotSupportedException
【发布时间】:2014-09-05 17:18:16
【问题描述】:

我正在运行一个使用语音识别的示例,但它无法在 Windows 8 或 2012 服务器上运行。

使用 win8 或 win2012server 以下代码不会返回记录,但在 win7 中会。

foreach(RecognizerInfo rec in System.Speech.Recognition.SpeechRecognitionEngine.InstalledRecognizers())
    {
        Console.WriteLine(rec.Culture);
    }

如果我在 win8 或 win2012 服务器上使用 LoadGrammar,则会引发异常:

_recognizer.LoadGrammar (new Grammar (new GrammarBuilder (new Choices (_numbersGrammar.Keys.ToArray ()))) { Name = "Numbers_Grammar" });

“System.PlatformNotSupportedException”表示未安装识别器。

堆栈跟踪:

System.Speech.Recognition.RecognizerBase.Initialize(SapiRecognizer 识别器,布尔 inproc) em System.Speech.Recognition.SpeechRecognitionEngine.get_RecoBase() em System.Speech.Recognition.SpeechRecognitionEngine.LoadGrammar(语法 语法) em SpeechRecognition.CaptchaSpeechManager..ctor(Int32 字母计数,Int32 等待毫秒)在 ....cs:线 第289章 e:\TestCenter\SpeechRecognition\SpeechRecognition\Program.cs:linha 24 em System.AppDomain._nExecuteAssembly(RuntimeAssembly 程序集, 字符串 [] 参数)在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext、ContextCallback 回调、对象状态、布尔值 preserveSyncCtx) 时间 System.Threading.ExecutionContext.Run(ExecutionContext executionContext、ContextCallback 回调、对象状态、布尔值 preserveSyncCtx) 时间 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback 回调, 对象状态) em System.Threading.ThreadHelper.ThreadStart()

我必须安装什么?我尝试安装 Speech SDK 11,但它会关闭直到完成 oO

有人知道这个操作系统不兼容吗?

有人知道另一个库可以做到这一点吗?

谢谢!

【问题讨论】:

    标签: c# windows-8 speech-recognition windows-server-2012


    【解决方案1】:

    您使用的是用于 Speech SDK 5.3/5.4 的 System.Speech 命名空间,而您应该使用的是 Speech SDK 11 的 Microsoft.Speech,您可以在

    中找到它的程序集

    “C:\Program Files\Microsoft SDKs\Speech\v11.0\Assembly\Microsoft.Speech.dll”

    如果你安装到默认路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-01
      • 2011-09-16
      • 2017-10-14
      • 2018-04-17
      • 2018-02-23
      • 1970-01-01
      相关资源
      最近更新 更多