Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _recognizer = new SpeechRecognitionEngine();
- _recognizer.RequestRecognizerUpdate();
- _recognizer.LoadGrammar(new Grammar(new GrammarBuilder("hello computer")));
- _recognizer.SpeechRecognized += _recognizer_SpeechRecognized;
- _recognizer.SetInputToDefaultAudioDevice();
- _recognizer.RecognizeAsync(RecognizeMode.Multiple);
- void _recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
- {
- if (e.Result.Text == "hello computer")
- {
- saidhello = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement