public override void OnResults(SKRecognizer reco, SKRecognition results) { string text = null; if (results.Results.Length > 0) { text = results.FirstResult(); } else { text = "didn't hear you - please try again"; } TraceHelper.AddMessage("OnResults: " + text); speechStateDelegate.DynamicInvoke(SpeechState.Finished, "Finished: " + text); speechToTextDelegate.DynamicInvoke(text); // trace a bad state if (reco != recognizer) { TraceHelper.AddMessage("recognizer doesn't match"); } // cleanup CleanupSpeechKit(); speechOperationInProgress = false; }
private static void CleanupSpeechKit() { if (recognizer != null) { recognizer.Cancel(); recognizer.Dispose(); } recognizer = null; speechOperationInProgress = false; }
public override void OnRecordingDone(SKRecognizer reco) { TraceHelper.AddMessage("OnRecordingDone"); speechStateDelegate.DynamicInvoke(SpeechState.Recognizing, "Recognizing"); // trace a bad state if (reco != recognizer) { TraceHelper.AddMessage("Recognizer doesn't match"); } }
public override void OnRecordingBegin(SKRecognizer reco) { TraceHelper.AddMessage("OnRecordingBegin"); speechStateDelegate.DynamicInvoke(SpeechState.Listening, "Started recording"); // trace a bad state if (reco != recognizer) { TraceHelper.AddMessage("recognizer doesn't match"); } }
private static void DictationStart(string type) { // trace the operation TraceHelper.AddMessage("DictationStart"); // cleanup the current recognizer CleanupSpeechKit(); // set the flag speechOperationInProgress = true; // create a new recognizer instance recognizer = new SKRecognizer(type, SKEndOfSpeechDetection.SKLongEndOfSpeechDetection, "en_US", new RecognizerDelegate()); }
public override void OnError(SKRecognizer reco, NSError error, string suggestion) { string text = error.LocalizedDescription; TraceHelper.AddMessage("onError: " + text); speechStateDelegate.DynamicInvoke(SpeechState.Finished, text); // trace a bad state if (reco != recognizer) { TraceHelper.AddMessage("recognizer doesn't match"); } // cleanup CleanupSpeechKit(); speechOperationInProgress = false; }
public override void OnResults(SKRecognizer reco, SKRecognition results) { string text = null; if (results.Results.Length > 0) text = results.FirstResult(); else text = "didn't hear you - please try again"; TraceHelper.AddMessage("OnResults: " + text); speechStateDelegate.DynamicInvoke(SpeechState.Finished, "Finished: " + text); speechToTextDelegate.DynamicInvoke(text); // trace a bad state if (reco != recognizer) TraceHelper.AddMessage("recognizer doesn't match"); // cleanup CleanupSpeechKit(); speechOperationInProgress = false; }
public override void OnRecordingDone(SKRecognizer reco) { TraceHelper.AddMessage("OnRecordingDone"); speechStateDelegate.DynamicInvoke(SpeechState.Recognizing, "Recognizing"); // trace a bad state if (reco != recognizer) TraceHelper.AddMessage("Recognizer doesn't match"); }
public override void OnRecordingBegin(SKRecognizer reco) { TraceHelper.AddMessage("OnRecordingBegin"); speechStateDelegate.DynamicInvoke(SpeechState.Listening, "Started recording"); // trace a bad state if (reco != recognizer) TraceHelper.AddMessage("recognizer doesn't match"); }
public override void OnError(SKRecognizer reco, NSError error, string suggestion) { string text = error.LocalizedDescription; TraceHelper.AddMessage("onError: " + text); speechStateDelegate.DynamicInvoke(SpeechState.Finished, text); // trace a bad state if (reco != recognizer) TraceHelper.AddMessage("recognizer doesn't match"); // cleanup CleanupSpeechKit(); speechOperationInProgress = false; }
private static void DictationStart(string type) { // trace the operation TraceHelper.AddMessage("DictationStart"); // cleanup the current recognizer CleanupSpeechKit(); // set the flag speechOperationInProgress = true; // create a new recognizer instance recognizer = new SKRecognizer(type, SKEndOfSpeechDetection.SKLongEndOfSpeechDetection, "en_US", new RecognizerDelegate()); }
private static void CleanupSpeechKit() { if (recognizer != null) { recognizer.Cancel(); recognizer.Dispose(); } recognizer = null; speechOperationInProgress = false; }