/**@class android.speech.RecognitionService.Callback @extends java.lang.Object This class receives callbacks from the speech recognition service and forwards them to the user. An instance of this class is passed to the {@link RecognitionService#onStartListening(Intent, android.speech.RecognitionService.Callback)} method. Recognizers may call these methods on any thread. */ var Callback = { /**The service should call this method when the user has started to speak. */ beginningOfSpeech : function( ) {}, /**The service should call this method when sound has been received. The purpose of this function is to allow giving feedback to the user regarding the captured audio. @param {Object {byte[]}} buffer a buffer containing a sequence of big-endian 16-bit integers representing a single channel audio stream. The sample rate is implementation dependent. */ bufferReceived : function( ) {}, /**The service should call this method after the user stops speaking. */ endOfSpeech : function( ) {}, /**The service should call this method when a network or recognition error occurred. @param {Number} error code is defined in {@link SpeechRecognizer} */ error : function( ) {}, /**The service should call this method when partial recognition results are available. This method can be called at any time between {@link #beginningOfSpeech}() and {@link #results}(Bundle) when partial results are ready. This method may be called zero, one or multiple times for each call to {@link android.speech.SpeechRecognizer#startListening(Intent)}, depending on the speech recognition service implementation. @param {Object {Bundle}} partialResults the returned results. To retrieve the results in ArrayList<String> format use {@link Bundle#getStringArrayList(String)} with {@link SpeechRecognizer#RESULTS_RECOGNITION} as a parameter */ partialResults : function( ) {}, /**The service should call this method when the endpointer is ready for the user to start speaking. @param {Object {Bundle}} params parameters set by the recognition service. Reserved for future use. */ readyForSpeech : function( ) {}, /**The service should call this method when recognition results are ready. @param {Object {Bundle}} results the recognition results. To retrieve the results in {@code ArrayList<String>} format use {@link Bundle#getStringArrayList(String)} with {@link SpeechRecognizer#RESULTS_RECOGNITION} as a parameter */ results : function( ) {}, /**The service should call this method when the sound level in the audio stream has changed. There is no guarantee that this method will be called. @param {Number} rmsdB the new RMS dB value */ rmsChanged : function( ) {}, /**Return the Linux uid assigned to the process that sent you the current transaction that is being processed. This is obtained from {@link Binder#getCallingUid()}. */ getCallingUid : function( ) {}, };