2012-04-23 44 views
1

我試圖將Microsoft Speech Platform與Kinect集成,我遇到了方法:SpeechRecognitionEngine.InstalledRecognizers(),它根本不運行。當我從我的班級調用方法時,執行不會繼續。我使用這種方法來獲取Kinect識別器。InstalledRecognizers()不運行

有什麼問題?這是我使用該方法的代碼片段InstalledRecognizers()

RecognizerInfo obtenerReconocedorKinect() 
    { 

     String details; 

     System.Collections.ObjectModel.ReadOnlyCollection<RecognizerInfo> recs = SpeechRecognitionEngine.InstalledRecognizers(); 

     foreach (RecognizerInfo recInfo in recs) 
     { 
      if (recInfo.AdditionalInfo.ContainsKey("Kinect")) 
      { 
       details = recInfo.AdditionalInfo["Kinect"]; 
       if (details == "True" && recInfo.Culture.Name == "en-US") 
       { 
        return recInfo; 
       } 
      } 
     } 
     return null; 
    } 

在此先感謝。

+0

我試過你的代碼,它適用於我。你正在使用哪個程序集進行語音識別?此外,如果您的代碼中斷並且您沒有看到任何異常,則可以更改一些設置以引發所有異常:在Visual Studio 2010中,轉至調試>異常>選中所有框。那麼也許你會得到更多關於哪裏出錯的信息。 – 2012-04-23 14:05:27

+0

我在http://www.microsoft.com/download/en/details.aspx?id=24974中安裝了x86版本。我添加爲Microsoft SDK \ Assembly – honnix 2012-04-23 15:18:52

+0

中的DLL引用Microsoft.Speech.dll中的System.Runtime.InteropServices.COMException異常。 Addiotional info:未註冊的類REGDB_E_CLASSNOTREG。 – honnix 2012-04-23 15:55:45

回答

2

所以問題是:

一個System.Runtime.InteropServices.COMException在Microsoft.Speech.dll,出現以下錯誤:沒有註冊類REGDB_E_CLASSNOTREG

的問題已經解決了重新安裝Kinect SDK

+1

工程,但這是一種痛苦,但它的價值 – 2012-04-24 15:05:54

+0

即時通訊與Microsoft.Speech sdk 11相同... – guiomie 2012-08-30 01:09:02