public class SoundTrigger extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SoundTrigger.ConfidenceLevel
Confidence level for users defined in a keyphrase
|
static class |
SoundTrigger.GenericRecognitionEvent
Sub-class of RecognitionEvent specifically for sound-trigger based sound
models(non-keyphrase).
|
static class |
SoundTrigger.GenericSoundModel
A GenericSoundModel is a specialized
SoundTrigger.SoundModel for non-voice sound
patterns. |
static class |
SoundTrigger.Keyphrase
A Keyphrase describes a key phrase that can be detected by a
SoundTrigger.KeyphraseSoundModel |
static class |
SoundTrigger.KeyphraseRecognitionEvent
Specialized
SoundTrigger.RecognitionEvent for a key phrase detection. |
static class |
SoundTrigger.KeyphraseRecognitionExtra
Additional data conveyed by a
SoundTrigger.KeyphraseRecognitionEvent
for a key phrase detection. |
static class |
SoundTrigger.KeyphraseSoundModel
A KeyphraseSoundModel is a specialized
SoundTrigger.SoundModel for key phrases. |
static class |
SoundTrigger.ModuleProperties
A ModuleProperties describes a given sound trigger hardware module
managed by the native sound trigger service.
|
static class |
SoundTrigger.RecognitionConfig
A RecognitionConfig is provided to
SoundTriggerModule#startRecognition(int, RecognitionConfig) to configure the
recognition request. |
static class |
SoundTrigger.RecognitionEvent
A RecognitionEvent is provided by the
StatusListener#onRecognition(RecognitionEvent)
callback upon recognition success or failure. |
static class |
SoundTrigger.SoundModel
A SoundModel describes the attributes and contains the binary data used by the hardware
implementation to detect a particular sound pattern.
|
static class |
SoundTrigger.SoundModelEvent
A SoundModelEvent is provided by the
StatusListener#onSoundModelUpdate(SoundModelEvent)
callback when a sound model has been updated by the implementation |
static interface |
SoundTrigger.StatusListener
Interface provided by the client application when attaching to a
SoundTriggerModule
to received recognition and error notifications. |
Modifier and Type | Field and Description |
---|---|
static int |
RECOGNITION_MODE_USER_AUTHENTICATION
Trigger only if one user is authenticated
|
static int |
RECOGNITION_MODE_USER_IDENTIFICATION
Trigger only if one user is identified
|
static int |
RECOGNITION_MODE_VOICE_TRIGGER
Simple recognition of the key phrase
|
static int |
RECOGNITION_STATUS_ABORT
Recognition aborted (e.g. capture preempted by anotehr use case
|
static int |
RECOGNITION_STATUS_FAILURE
Recognition failure
|
static int |
RECOGNITION_STATUS_SUCCESS
Recognition success
|
static int |
SERVICE_STATE_DISABLED
Sound trigger service is disabled
|
static int |
SERVICE_STATE_ENABLED
Sound trigger service is enabled
|
static int |
SOUNDMODEL_STATUS_UPDATED
Sound Model was updated
|
static int |
STATUS_BAD_VALUE |
static int |
STATUS_DEAD_OBJECT |
static int |
STATUS_ERROR |
static int |
STATUS_INVALID_OPERATION |
static int |
STATUS_NO_INIT |
static int |
STATUS_OK |
static int |
STATUS_PERMISSION_DENIED |
Constructor and Description |
---|
SoundTrigger() |
Modifier and Type | Method and Description |
---|---|
static SoundTriggerModule |
attachModule(int moduleId,
SoundTrigger.StatusListener listener,
Handler handler)
Get an interface on a hardware module to control sound models and recognition on
this module.
|
static int |
listModules(ArrayList<SoundTrigger.ModuleProperties> modules)
Returns a list of descriptors for all hardware modules loaded.
|
public static final int STATUS_OK
public static final int STATUS_ERROR
public static final int STATUS_PERMISSION_DENIED
public static final int STATUS_NO_INIT
public static final int STATUS_BAD_VALUE
public static final int STATUS_DEAD_OBJECT
public static final int STATUS_INVALID_OPERATION
public static final int RECOGNITION_MODE_VOICE_TRIGGER
public static final int RECOGNITION_MODE_USER_IDENTIFICATION
public static final int RECOGNITION_MODE_USER_AUTHENTICATION
public static final int RECOGNITION_STATUS_SUCCESS
public static final int RECOGNITION_STATUS_ABORT
public static final int RECOGNITION_STATUS_FAILURE
public static final int SOUNDMODEL_STATUS_UPDATED
public static final int SERVICE_STATE_ENABLED
public static final int SERVICE_STATE_DISABLED
public static int listModules(ArrayList<SoundTrigger.ModuleProperties> modules)
modules
- A ModuleProperties array where the list will be returned.STATUS_OK
in case of success
- STATUS_ERROR
in case of unspecified error
- STATUS_PERMISSION_DENIED
if the caller does not have system permission
- STATUS_NO_INIT
if the native service cannot be reached
- STATUS_BAD_VALUE
if modules is null
- STATUS_DEAD_OBJECT
if the binder transaction to the native service failspublic static SoundTriggerModule attachModule(int moduleId, SoundTrigger.StatusListener listener, Handler handler)
moduleId
- Sound module system identifier SoundTrigger.ModuleProperties.id
. mandatory.listener
- SoundTrigger.StatusListener
interface. Mandatory.handler
- the Handler that will receive the callabcks. Can be null if default handler
is OK.