public final class SoundTriggerDetector extends Object
VoiceInteractionService
instead. Access to this class is protected by a permission
granted only to system or privileged apps.Modifier and Type | Class and Description |
---|---|
static class |
SoundTriggerDetector.Callback |
static class |
SoundTriggerDetector.EventPayload
|
static interface |
SoundTriggerDetector.RecognitionFlags |
Modifier and Type | Field and Description |
---|---|
static int |
RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS
Recognition flag for
startRecognition(int) that indicates
whether the recognition should keep going on even after the
model triggers. |
static int |
RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO
Recognition flag for
startRecognition(int) that indicates
whether the trigger audio for hotword needs to be captured. |
static int |
RECOGNITION_FLAG_NONE
Empty flag for
startRecognition(int) . |
Modifier and Type | Method and Description |
---|---|
void |
dump(String prefix,
PrintWriter pw) |
boolean |
startRecognition(int recognitionFlags)
Starts recognition on the associated sound model.
|
boolean |
stopRecognition()
Stops recognition for the associated model.
|
public static final int RECOGNITION_FLAG_NONE
startRecognition(int)
.public static final int RECOGNITION_FLAG_CAPTURE_TRIGGER_AUDIO
startRecognition(int)
that indicates
whether the trigger audio for hotword needs to be captured.public static final int RECOGNITION_FLAG_ALLOW_MULTIPLE_TRIGGERS
startRecognition(int)
that indicates
whether the recognition should keep going on even after the
model triggers.
If this flag is specified, it's possible to get multiple
triggers after a call to startRecognition(int)
, if the model
triggers multiple times.
When this isn't specified, the default behavior is to stop recognition once the
trigger happenss, till the caller starts recognition again.public boolean startRecognition(int recognitionFlags)
SoundTriggerDetector.Callback
.public boolean stopRecognition()
public void dump(String prefix, PrintWriter pw)