public static class RecognitionCallback.Adapter
- Object
- RecognitionCallback.Adapter
ImplementsRecognitionCallback
Known subtypesTimedRecognitionCallback.Adapter
No-op adapter. Subclass and override only what you need.
Constructors
public Adapter() |
Methods
public void onPartialResult(String transcript) | Best-effort transcript while the user is still speaking. |
public void onResult(String transcript, float confidence, String[] alternatives) | Final transcript for a single utterance. |
public void onEnd() | Recognition session ended (timeout, mic released, or SpeechRecognizer.stop()). |
public void onError(Throwable t) | Recognition failed (no permission, no network for online engines, hardware error). |
Inherited nested types
Inherited methods
Constructor details
Adapter
public Adapter()Method details
onPartialResult
public void onPartialResult(String transcript)Best-effort transcript while the user is still speaking. May
fire many times before
onResult. Skip overriding if
RecognitionOptions.setPartialResults(false) was passed.onResult
public void onResult(String transcript, float confidence, String[] alternatives)Final transcript for a single utterance.
confidence is in
[0.0, 1.0] when the platform supplies one, or -1 when it
doesn’t. alternatives may be empty.onEnd
public void onEnd()Recognition session ended (timeout, mic released, or
SpeechRecognizer.stop()). No more callbacks will fire.onError
public void onError(Throwable t)Recognition failed (no permission, no network for online
engines, hardware error).