/// <summary>Callback method for recording error event</summary> public void onError(Recognizer recognizer, SpeechError error) { System.Diagnostics.Debug.WriteLine("PhoneGapSpeechPlugin: Recognizer.Listener.onError: Entered method."); if (recognizer != currentRecognizer) return; currentRecognizer = null; recording = false; // Display the error + suggestion in the edit box String detail = error.getErrorDetail(); String suggestion = error.getSuggestion(); System.Diagnostics.Debug.WriteLine("PhoneGapSpeechPlugin: Recognizer.Listener.onError: Detail = " + detail + "Suggestion = "+suggestion); ReturnObject returnObject = new ReturnObject(); try{ setReturnCode(returnObject, RC_RECO_FAILURE, "Reco Failure"); returnObject.eventName = EVENT_RECO_ERROR; returnObject.result = detail; } catch(Exception e){ System.Diagnostics.Debug.WriteLine("PhoneGapSpeechPlugin: Recognizer.Listener.onError: Error storing results: " + e); } PluginResult result = new PluginResult(PluginResult.Status.OK, returnObject); DispatchCommandResult( result ); // for debugging purpose: printing out the speechkit session id System.Diagnostics.Debug.WriteLine("PhoneGapSpeechPlugin: Recognizer.Listener.onError: Leaving method."); }