// Handle the SpeechRecognized event. private void Recognizer_SpeechRecognized(object sender, Microsoft.Speech.Recognition.SpeechRecognizedEventArgs e) { var name = e.Result.Grammar.Name; var words = new string[e.Result.Words.Count]; for (var i = 0; i < e.Result.Words.Count; i++) { words[i] = e.Result.Words[i].Text; } try { _loadedGrammarDictionary[name].Callback(name, words); //_loadedGrammarDictionary[name](name, words); } catch { // ignore for now } }
void _speechService_SpeechRecognized(object sender, Microsoft.Speech.Recognition.SpeechRecognizedEventArgs e) { const double ConfidenceThreshold = 0.7; if (e.Result.Confidence >= ConfidenceThreshold) { _speechText = e.Result.Semantics.Value.ToString(); switch (e.Result.Semantics.Value.ToString()) { case "START CALIBRATION": _speechService.Speak("Working on it Boss. Might I say myself that this is a great presentation!"); StartCalibration(); break; case "CALIBRATION COMPLETE": //since the calibration window is a modal dialog, this won't get called until the calibration window is closed, which is to late therefore, //don't use speech to close this calibration window as we don't want to allow user to keep calibration open during active sessions //StopCalibration(); break; } } }
private void Recogn_SpeechRecognized(object sender, Microsoft.Speech.Recognition.SpeechRecognizedEventArgs e) { clips.Run(); HandleResponse(); }
void Recognizer_SpeechRecognized(object sender, Microsoft.Speech.Recognition.SpeechRecognizedEventArgs e) { voiceServer.informListeners(e.Result.Confidence + "#" + e.Result.Text); }