microsoft.speech を使用して、自分のマシンの wave ファイルから音声を認識しています。
選択セットに単語を追加する代わりに、テキスト ファイルから単語を読み取り、その単語を文法に追加しています。
しかし、文法に 73 を超える単語を追加しようとすると、記録したファイルが認識されないことがわかりました。
これが私のコードです:
System.IO.StreamReader file = new System.IO.StreamReader(filePath);
while ((line = file.ReadLine()) != null)
{
if (line != "")
{
words.Add(line);
counter++;
}
}
file.Close();
gb.Append(words);
// Create the actual Grammar instance, with the words from the source audio.
g = new Grammar(gb);
// Load the created grammar onto the speech recognition engine.
recognitionEngine.LoadGrammarAsync(g);
public void recognizer_SpeechRecognizedRecording(object sender, SpeechRecognizedEventArgs e)
{
string text = e.Result.Text;
}
しかし、テキスト ファイルに 73 を超える単語が存在する場合、音声認識の記録イベントでヒットが発生しません。
誰かがこれを達成するのを手伝ってくれますか?