private void RecEngine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { var result = e.Result; float conf = e.Result.Confidence; if (conf < 0.60) { return; } switch (result.Text) { case "One Wakeup": react = true; TalkBack("Say a command "); break; case "One Sleep": react = false; TalkBack("Wake me up, whenever you need"); break; } if (react) { var words = result.Words; if (words.Count > 1) { OnUserSpeakCommand?.Invoke(words[1].Text); } } }
public void TestCallBack() { talkBack.Speak("Welcome to Advanced Speech Engine"); OnUserSpeakCommand?.Invoke("Himanshu"); }