public
static
abstract
class
AlwaysOnHotwordDetector.Callback
extends Object
java.lang.Object | |
↳ | android.service.voice.AlwaysOnHotwordDetector.Callback |
Callbacks for always-on hotword detection.
Public constructors | |
---|---|
AlwaysOnHotwordDetector.Callback()
|
Public methods | |
---|---|
abstract
void
|
onAvailabilityChanged(int status)
Called when the hotword availability changes. |
abstract
void
|
onDetected(AlwaysOnHotwordDetector.EventPayload eventPayload)
Called when the keyphrase is spoken. |
abstract
void
|
onError()
Called when the detection fails due to an error. |
abstract
void
|
onRecognitionPaused()
Called when the recognition is paused temporarily for some reason. |
abstract
void
|
onRecognitionResumed()
Called when the recognition is resumed after it was temporarily paused. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
void onAvailabilityChanged (int status)
Called when the hotword availability changes. This indicates a change in the availability of recognition for the given keyphrase. It's called at least once with the initial availability.
Availability implies whether the hardware on this system is capable of listening for the given keyphrase or not.Parameters | |
---|---|
status |
int
|
void onDetected (AlwaysOnHotwordDetector.EventPayload eventPayload)
Called when the keyphrase is spoken. This implicitly stops listening for the keyphrase once it's detected. Clients should start a recognition again once they are done handling this detection.
Parameters | |
---|---|
eventPayload |
AlwaysOnHotwordDetector.EventPayload :
Payload data for the detection event.
This may contain the trigger audio, if requested when calling
startRecognition(int) .
|
void onRecognitionPaused ()
Called when the recognition is paused temporarily for some reason. This is an informational callback, and the clients shouldn't be doing anything here except showing an indication on their UI if they have to.
void onRecognitionResumed ()
Called when the recognition is resumed after it was temporarily paused. This is an informational callback, and the clients shouldn't be doing anything here except showing an indication on their UI if they have to.