簡単な音声認識プログラムを開始しようとしていますが、機能しません。いくつかの言語 (en-GB と en-US) をインストールしましたが、次を使用するたびに:
SpeechRecognitionEngine.InstalledRecognizers
空のコレクションを返します。認識エンジンを起動しようとしても、「認識エンジンがインストールされていません」と返されます。しかし、言語を再インストールすると、既にインストールされていると表示されます。
using ( SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US")))
{
// Create and load a dictation grammar.
recognizer.LoadGrammar(new DictationGrammar());
// Add a handler for the speech recognized event.
recognizer.SpeechRecognized +=
new EventHandler<SpeechRecognizedEventArgs>(recognizer_SpeechRecognized);
// Configure input to the speech recognizer.
recognizer.SetInputToDefaultAudioDevice();
// Start asynchronous, continuous speech recognition.
recognizer.RecognizeAsync(RecognizeMode.Multiple);
// Keep the console window open.
while (true)
{
Console.ReadLine();
}
}
インストールされているレコグナイザーが見つからないのはなぜですか?
編集:
これは例外です: {System.ArgumentException: 必要な ID の認識エンジンが見つかりません。パラメータ名: Culture at System.Speech.Recognition.SpeechRecognitionEngine..ctor(CultureInfo culture)
and:var recognizers = SpeechRecognitionEngine.InstalledRecognizers();
カウントが 0 のコレクションを返します