2014-09-05 83 views
1

我正在運行使用語音識別的示例,它不適用於Windows 8或2012服務器。語音識別平臺NotSupportedException

使用win8或win2012server下面的代碼不返回記錄,但它在win7中。

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

如果我使用一個LoadGrammar使用win8的或win2012服務器時,它拋出一個異常:

_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 lettersCount,的Int32 waitMilliseconds)在 .... CS:線 289 EM SpeechRecognition.Program.Main(字串[] args)NA E: \ TestCenter的\ SpeechRec ognition \語音識別\的Program.cs:linha 24 EM System.AppDomain._nExecuteAssembly(RuntimeAssembly組件, 字串[] args)在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
EM System.Threading.ExecutionContext.RunInternal (的ExecutionContext 的ExecutionContext,ContextCallback回調,對象的狀態,布爾 preserveSyncCtx)EM System.Threading.ExecutionContext.Run(的ExecutionContext 的ExecutionContext,ContextCallback回調,對象的狀態,布爾 preserveSyncCtx)EM System.Threading.ExecutionContext.Run(的ExecutionContext executionContext,ContextCallback回調,對象狀態)em System.Threading.ThreadHelper.ThreadStart()

我需要安裝什麼?我試圖安裝Speech SDK 11,但它關閉直到完成oO

有沒有人知道與此操作系統有任何不兼容?

有沒有人知道另一個lib做到這一點?

謝謝!

回答

1

您正在使用System.Speech命名空間,其用於語音SDK 5.3/5.4,而你應該使用Microsoft.Speech這是在Speech SDK 11之一,你可以在

「C發現其組裝:\ Program Files文件\ Microsoft SDKs \ Speech \ v11.0 \ Assembly \ Microsoft.Speech.dll「

如果您將它安裝到默認路徑。