com.nuance.nmdp.speechkit
Interface Recognizer.Listener

Enclosing interface:
Recognizer

public static interface Recognizer.Listener

The Recognizer.Listener interface defines the callback methods called by a Recognizer object. These methods indicate the flow of the recognition process. The listener will be notified when the recording has begun, when the recording has ended, and when the recognition process is finished.

If the Recognizer object was given a Handler when created, the listener methods will be posted to the handler thread. Otherwise, they will be called from a thread owned by SpeechKit.


Method Summary
 void onError(Recognizer recognizer, SpeechError error)
          Called when the recognition process completes with an error.
 void onRecordingBegin(Recognizer recognizer)
          Called when the Recognizer starts recording audio.
 void onRecordingDone(Recognizer recognizer)
          Called when the Recognizer stops recording audio.
 void onResults(Recognizer recognizer, Recognition results)
          Called when the recognition process completes successfully.
 

Method Detail

onRecordingBegin

void onRecordingBegin(Recognizer recognizer)
Called when the Recognizer starts recording audio.

Parameters:
recognizer - The Recognizer that started recording.

onRecordingDone

void onRecordingDone(Recognizer recognizer)
Called when the Recognizer stops recording audio.

Parameters:
recognizer - The Recognizer that stopped recording.

onResults

void onResults(Recognizer recognizer,
               Recognition results)
Called when the recognition process completes successfully.

This method is only called when the recognition process completes successfully. The results object contains a list of possible results, with the best result at index 0 or an empty list if no error occurred but no speech was detected.

Parameters:
recognizer - The Recognizer that completed.
results - The Recognition object containing the results.

onError

void onError(Recognizer recognizer,
             SpeechError error)
Called when the recognition process completes with an error.

This method is called when the recognition process results in an error due to any number of circumstances. The audio system may fail to initialize, the server connection may be disrupted or a parameter specified during initialization, such as language or authentication information was invalid.

Parameters:
recognizer - The Recognizer that had an error.
error - The recognition error.