java.lang.Object | |
↳ | android.service.voice.AlwaysOnHotwordDetector |
A class that lets a VoiceInteractionService implementation interact with always-on keyphrase detection APIs.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AlwaysOnHotwordDetector.Callback | Callbacks for always-on hotword detection. | ||||||||||
AlwaysOnHotwordDetector.EventPayload |
Additional payload for onDetected(AlwaysOnHotwordDetector.EventPayload) .
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS |
Recognition flag for startRecognition(int) that indicates
whether the recognition should keep going on even after the keyphrase triggers.
|
|||||||||
int | RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO |
Recognition flag for startRecognition(int) that indicates
whether the trigger audio for hotword needs to be captured.
|
|||||||||
int | RECOGNITION_MODE_USER_IDENTIFICATION | User identification performed with the keyphrase recognition. | |||||||||
int | RECOGNITION_MODE_VOICE_TRIGGER | Simple recognition of the key phrase. | |||||||||
int | STATE_HARDWARE_UNAVAILABLE | Indicates that recognition for the given keyphrase is not available on the system because of the hardware configuration. | |||||||||
int | STATE_KEYPHRASE_ENROLLED | Indicates that the given keyphrase is currently enrolled and it's possible to start recognition for it. | |||||||||
int | STATE_KEYPHRASE_UNENROLLED | Indicates that the given keyphrase is not enrolled. | |||||||||
int | STATE_KEYPHRASE_UNSUPPORTED | Indicates that recognition for the given keyphrase is not supported. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an intent to start the enrollment for the associated keyphrase.
| |||||||||||
Creates an intent to start the re-enrollment for the associated keyphrase.
| |||||||||||
Creates an intent to start the un-enrollment for the associated keyphrase.
| |||||||||||
Gets the recognition modes supported by the associated keyphrase.
| |||||||||||
Starts recognition for the associated keyphrase.
| |||||||||||
Stops recognition for the associated keyphrase.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Recognition flag for startRecognition(int)
that indicates
whether the recognition should keep going on even after the keyphrase triggers.
If this flag is specified, it's possible to get multiple triggers after a
call to startRecognition(int)
if the user speaks the keyphrase multiple times.
When this isn't specified, the default behavior is to stop recognition once the
keyphrase is spoken, till the caller starts recognition again.
Recognition flag for startRecognition(int)
that indicates
whether the trigger audio for hotword needs to be captured.
User identification performed with the keyphrase recognition.
Returned by getSupportedRecognitionModes()
Simple recognition of the key phrase.
Returned by getSupportedRecognitionModes()
Indicates that recognition for the given keyphrase is not available on the system because of the hardware configuration. No further interaction should be performed with the detector that returns this availability.
Indicates that the given keyphrase is currently enrolled and it's possible to start recognition for it.
Indicates that the given keyphrase is not enrolled. The caller may choose to begin an enrollment flow for the keyphrase.
Indicates that recognition for the given keyphrase is not supported. No further interaction should be performed with the detector that returns this availability.
Creates an intent to start the enrollment for the associated keyphrase.
This intent must be invoked using startActivityForResult(Intent, int)
.
Starting re-enrollment is only valid if the keyphrase is un-enrolled,
i.e. STATE_KEYPHRASE_UNENROLLED
,
otherwise createReEnrollIntent()
should be preferred.
Intent
to start enrollment for the given keyphrase.UnsupportedOperationException | if managing they keyphrase isn't supported.
Callers should only call this method after a supported state callback on
onAvailabilityChanged(int) to avoid this exception. |
---|---|
IllegalStateException | if the detector is in an invalid state.
This may happen if another detector has been instantiated or the
VoiceInteractionService hosting this detector has been shut down.
|
Creates an intent to start the re-enrollment for the associated keyphrase.
This intent must be invoked using startActivityForResult(Intent, int)
.
Starting re-enrollment is only valid if the keyphrase is already enrolled,
i.e. STATE_KEYPHRASE_ENROLLED
, otherwise invoking this may result in an error.
Intent
to start re-enrollment for the given keyphrase.UnsupportedOperationException | if managing they keyphrase isn't supported.
Callers should only call this method after a supported state callback on
onAvailabilityChanged(int) to avoid this exception. |
---|---|
IllegalStateException | if the detector is in an invalid state.
This may happen if another detector has been instantiated or the
VoiceInteractionService hosting this detector has been shut down.
|
Creates an intent to start the un-enrollment for the associated keyphrase.
This intent must be invoked using startActivityForResult(Intent, int)
.
Starting re-enrollment is only valid if the keyphrase is already enrolled,
i.e. STATE_KEYPHRASE_ENROLLED
, otherwise invoking this may result in an error.
Intent
to start un-enrollment for the given keyphrase.UnsupportedOperationException | if managing they keyphrase isn't supported.
Callers should only call this method after a supported state callback on
onAvailabilityChanged(int) to avoid this exception. |
---|---|
IllegalStateException | if the detector is in an invalid state.
This may happen if another detector has been instantiated or the
VoiceInteractionService hosting this detector has been shut down.
|
Gets the recognition modes supported by the associated keyphrase.
UnsupportedOperationException | if the keyphrase itself isn't supported.
Callers should only call this method after a supported state callback on
onAvailabilityChanged(int) to avoid this exception. |
---|---|
IllegalStateException | if the detector is in an invalid state.
This may happen if another detector has been instantiated or the
VoiceInteractionService hosting this detector has been shut down.
|
Starts recognition for the associated keyphrase.
recognitionFlags | The flags to control the recognition properties. |
---|
UnsupportedOperationException | if the recognition isn't supported.
Callers should only call this method after a supported state callback on
onAvailabilityChanged(int) to avoid this exception. |
---|---|
IllegalStateException | if the detector is in an invalid state.
This may happen if another detector has been instantiated or the
VoiceInteractionService hosting this detector has been shut down.
|
Stops recognition for the associated keyphrase.
UnsupportedOperationException | if the recognition isn't supported.
Callers should only call this method after a supported state callback on
onAvailabilityChanged(int) to avoid this exception. |
---|---|
IllegalStateException | if the detector is in an invalid state.
This may happen if another detector has been instantiated or the
VoiceInteractionService hosting this detector has been shut down.
|