private SpeechRecognitionEngine rec = new SpeechRecognitionEngine(); rec.SetInputToDefaultAudioDevice(); string [] s={"My Computer","My Document","C Drive"}; grammerbuilder gb=new grammerBuilder(); gb.Append(s); rec.LoadGrammar(gb); rec.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(rec_SpeechRecognized); rec.RecognizeAsync(RecognizeMode.Multiple); //RecognizedPhrase wordes = new RecognizedPhrase(); // this is an event method void rec_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { foreach (RecognizedWordUnit word in e.Result.Words) { strdata = strdata +" "+ word.Text; } textBox1.Text = strdata;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)