# Print output for @column tags ?> AlwaysOnHotwordDetector.Callback - Android SDK | Android Developers

Most visited

Recently visited

AlwaysOnHotwordDetector.Callback

public static abstract class AlwaysOnHotwordDetector.Callback
extends Object

java.lang.Object
   ↳ android.service.voice.AlwaysOnHotwordDetector.Callback


Callbacks for always-on hotword detection.

Summary

Public constructors

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

Public constructors

Callback

public Callback ()

Public methods

onAvailabilityChanged

public abstract 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

See also:

onDetected

public abstract 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 AlwaysOnHotwordDetector#startRecognition(int). This value cannot be null.

onError

public abstract void onError ()

Called when the detection fails due to an error.

onRecognitionPaused

public abstract 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.

onRecognitionResumed

public abstract 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.