使用下面的代码可以返回第一个识别结果,但不会返回其他所有结果。我做错了什么?我需要在某种循环中吗?
public void Transcribe()
{
SpeechRecognitionEngine SRE = new SpeechRecognitionEngine();
SRE.LoadGrammar(new DictationGrammar());
SRE.SetInputToWaveFile(_fileName);
SRE.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(SRE_SpeechRecognized);
SRE.RecognizeCompleted += new EventHandler<RecognizeCompletedEventArgs>(SRE_RecognizeCompleted);
SRE.RecognizeAsync(RecognizeMode.Multiple);
}
void SRE_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e)
{
Console.WriteLine(e.Result.Text);
}
void SRE_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
}