Speech语音识别的一个问题,谢谢
using System.Speech.Synthesis;
using System.Speech.Recognition;
public static void Ear()
{
SpeechRecognitionEngine SRE = new SpeechRecognitionEngine();
SRE.SetInputToDefaultAudioDevice();
GrammarBuilder GB = new GrammarBuilder();
GB.Append(new Choices("cut", "good"));
Grammar G = new Grammar(GB);
SRE.UnloadAllGrammars();
SRE.LoadGrammar(G);
SRE.SpeechRecognized +=new EventHandler<SpeechRecognizedEventArgs>(SRE_SpeechRecognized);
SRE.SpeechHypothesized += new EventHandler<SpeechHypothesizedEventArgs>(SRE_SpeechHypothesized);
}
程序编译能过,但是运行到SRE.SetInputToDefaultAudioDevice();这句就报一个错误Value does not fall within the expected range.
请各位帮下忙,谢谢大家了,我刚接触这个还很不熟悉呢。谢谢