语音识别平台不支持异常

本文关键字:异常 不支持 平台 语音识别 | 更新日期: 2023-09-27 18:20:44

我正在运行一个使用语音识别的示例,但它不能在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"表示未安装识别器。

StackTrace:

System.Speech.Recognition.IgnizerBase.Initialize(SapiRecognizer识别器,Boolean inproc)emSystem.Speech.Recognition.SpeechRecognitionEngine.get_RecoBase()emSystem.Speech.Recognition.SpeechRecognitionEngine.LoadGrammar(语法grammar)em SpeechRecognition.CaptchaSpeechManager.ctor(Int32lettersCount,Int32等待毫秒)….cs:line289 em SpeechRecognition.Program.Main(String[]args)nae: ''测试中心''语音识别''语音识别''Program.cs:linha 24em System.AppDomain_nExecuteAssembly(运行时程序集程序集,中的字符串[]args)Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
em System.Threading.ExecutionContext.RunInternal(ExecutionContextexecutionContext,ContextCallback回调,对象状态,布尔值preserveSyncCtx)emSystem.Threading.ExecutionContext.Run(ExecutionContextexecutionContext,ContextCallback回调,对象状态,布尔值preserveSyncCtx)emSystem.Threading.ExecutionContext.Run(ExecutionContextexecutionContext,ContextCallback回调,Object state)emSystem.Threading.ThreadHelper.ThreadStart()

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

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

有人知道另一个自由吗?

谢谢!

语音识别平台不支持异常

您使用的是用于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"

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