private void speech_Recognized(object sender, SpeechRecognizedEventArgs e) { //Inform the ViewcontrollerConnector ViewControllerConnector.StartedCommandRecognition = false; //Activate the ending function _End(); //Play results audio AudioHandler.Results(); //Speak the answer from the CommandHandler var result_string = CommandHandler.Handle(e.Result.Text); if (!result_string.StartsWith("SUDO:")) { ResultCallback(e.Result.Text, result_string); } else { ResultCallback(e.Result.Text, "Here's what I've got"); } synthesizer.SpeakAsync(result_string.Replace("SUDO:", "")); //Null the recognizer _recognizer = null; //Start AISA Handler again AISAHandler.Start(true); timer.Stop(); }
private void speech_Recognized(object sender, SpeechRecognizedEventArgs e) { if (ViewControllerConnector.PaperStarted == false) { //Inform the ViewcontrollerConnector ViewControllerConnector.StartedCommandRecognition = false; //Activate the ending function _End(); //Speak the answer from the CommandHandler var result_string = CommandHandler.Handle(e.Result.Text); var async = false; if (result_string.StartsWith("ASYNC:")) { //Remove async keyword async = true; result_string = result_string.Replace("ASYNC:", ""); } else { //Play results audio AudioHandler.Results(); } if (result_string == "SUDO:Started the paper") { //Start the paper ViewControllerConnector.startPaper(Context.previousPaper[0], Context.previousPaper[1]); ViewControllerConnector.PaperStarted = true; } if (!result_string.StartsWith("SUDO:")) { ResultCallback(e.Result.Text, result_string, async); } else { ResultCallback(e.Result.Text, "Here's what I've got", async); } synthesizer.SpeakAsync(result_string.Replace("SUDO:", "")); //Null the recognizer _recognizer = null; //Start AISA Handler again AISAHandler.Start(true); timer.Stop(); } }
private void StopRecognition() { _End(); //Play wrong audio AudioHandler.Wrong(); //Say that it's wrong var result_string = CommandHandler.Handle("ERR:WRONG"); synthesizer.SpeakAsync(result_string); ResultCallback("Couldn't recognize", result_string); //Null the recognizer _recognizer = null; //Start AISA Handler again AISAHandler.Start(); }
private void speech_Recognized(object sender, SpeechRecognizedEventArgs e) { //Activate the ending function _End(); //Play results audio AudioHandler.Results(); //Speak the answer from the CommandHandler var result_string = CommandHandler.Handle(e.Result.Text); synthesizer.SpeakAsync(result_string); ResultCallback(e.Result.Text, result_string); //Null the recognizer _recognizer = null; //Start AISA Handler again AISAHandler.Start(true); timer.Stop(); }