|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
---|
void onRecordingBegin(Recognizer recognizer)
Recognizer
starts recording audio.
recognizer
- The Recognizer
that started recording.void onRecordingDone(Recognizer recognizer)
Recognizer
stops recording audio.
recognizer
- The Recognizer
that stopped recording.void onResults(Recognizer recognizer, Recognition results)
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.
recognizer
- The Recognizer
that completed.results
- The Recognition
object containing the results.void onError(Recognizer recognizer, SpeechError 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.
recognizer
- The Recognizer
that had an error.error
- The recognition error.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |