public class SoundTriggerHelper extends Object implements SoundTrigger.StatusListener
SoundTrigger
APIs. Supports two types of models:
(i) A voice model which is exported via the VoiceInteractionService
. There can only be
a single voice model running on the DSP at any given time.
(ii) Generic sound-trigger models: Supports multiple of these.
Currently this just acts as an abstraction over all SoundTrigger API calls.Modifier and Type | Field and Description |
---|---|
static int |
STATUS_ERROR
Return codes for
#startRecognition(int, KeyphraseSoundModel,
IRecognitionStatusCallback, RecognitionConfig) ,
#stopRecognition(int, IRecognitionStatusCallback) |
static int |
STATUS_OK |
Modifier and Type | Method and Description |
---|---|
SoundTrigger.ModuleProperties |
getModuleProperties() |
void |
onRecognition(SoundTrigger.RecognitionEvent event)
Called when recognition succeeds of fails
|
void |
onServiceDied()
Called when the sound trigger native service dies
|
void |
onServiceStateChange(int state)
Called when the sound trigger native service state changes.
|
void |
onSoundModelUpdate(SoundTrigger.SoundModelEvent event)
Called when a sound model has been updated
|
public static final int STATUS_ERROR
#startRecognition(int, KeyphraseSoundModel,
IRecognitionStatusCallback, RecognitionConfig)
,
#stopRecognition(int, IRecognitionStatusCallback)
public static final int STATUS_OK
public SoundTrigger.ModuleProperties getModuleProperties()
public void onRecognition(SoundTrigger.RecognitionEvent event)
SoundTrigger.StatusListener
onRecognition
in interface SoundTrigger.StatusListener
public void onSoundModelUpdate(SoundTrigger.SoundModelEvent event)
SoundTrigger.StatusListener
onSoundModelUpdate
in interface SoundTrigger.StatusListener
public void onServiceStateChange(int state)
SoundTrigger.StatusListener
onServiceStateChange
in interface SoundTrigger.StatusListener
state
- Native service state. One of SoundTrigger.SERVICE_STATE_ENABLED
,
SoundTrigger.SERVICE_STATE_DISABLED
public void onServiceDied()
SoundTrigger.StatusListener
onServiceDied
in interface SoundTrigger.StatusListener