首页 文章

语音识别PlatformNotSupportedException

提问于
浏览
1

我正在运行使用语音识别的示例,它不能在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 Recognizer,Boolean inproc)em System.Speech.Recognition.SpeechRecognitionEngine.get_RecoBase()em System.Speech.Recognition.SpeechRecognitionEngine.LoadGrammar(Grammar grammar)em SpeechRecognition.CaptchaSpeechManager..ctor (Int32 lettersCount,Int32 waitMilliseconds).... cs:line 289 em SpeechRecognition.Program.Main(String [] args)na e:\ TestCenter \ SpeechRecognition \ SpeechRecognition \ Program.cs:linha 24 em System.AppDomain._nExecuteAssembly (Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()em中的RuntimeAssembly程序集,String [] args)System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean preserveSyncCtx)em System.Threading.ExecutionContext.Run (ExecutionContext executionContext,ContextCallback callback,Object state,Boolean preserveSyncCtx)em System.Threading.ExecutionContext.Run(ExecutionContext executionContext,Contex tCallback回调,对象状态)em System.Threading.ThreadHelper.ThreadStart()

我需要安装什么?我试图安装Speech SDK 11,但它会关闭直到completition oO

有没有人知道与这个操作系统有任何不兼容性?

有人知道另一个lib这样做吗?

谢谢!

1 回答

  • 1

    您正在使用 System.Speech 名称空间用于Speech SDK 5.3 / 5.4,而您应该使用 Microsoft.Speech 这是Speech SDK 11,您可以在其中找到它的程序集

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

    如果您将其安装到默认路径 .

相关问题