FileDocCategorySizeDatePackage
SoundTrigger.javaAPI DocAndroid 5.1 API47328Thu Mar 12 22:22:10 GMT 2015android.hardware.soundtrigger

SoundTrigger

public class SoundTrigger extends Object
The SoundTrigger class provides access via JNI to the native service managing the sound trigger HAL.
hide

Fields Summary
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
Simple recognition of the key phrase
public static final int
RECOGNITION_MODE_USER_IDENTIFICATION
Trigger only if one user is identified
public static final int
RECOGNITION_MODE_USER_AUTHENTICATION
Trigger only if one user is authenticated
public static final int
RECOGNITION_STATUS_SUCCESS
Recognition success
public static final int
RECOGNITION_STATUS_ABORT
Recognition aborted (e.g. capture preempted by anotehr use case
public static final int
RECOGNITION_STATUS_FAILURE
Recognition failure
public static final int
SOUNDMODEL_STATUS_UPDATED
Sound Model was updated
public static final int
SERVICE_STATE_ENABLED
Sound trigger service is enabled
public static final int
SERVICE_STATE_DISABLED
Sound trigger service is disabled
Constructors Summary
Methods Summary
public static SoundTriggerModuleattachModule(int moduleId, android.hardware.soundtrigger.SoundTrigger$StatusListener listener, android.os.Handler handler)
Get an interface on a hardware module to control sound models and recognition on this module.

param
moduleId Sound module system identifier {@link ModuleProperties#id}. mandatory.
param
listener {@link StatusListener} interface. Mandatory.
param
handler the Handler that will receive the callabcks. Can be null if default handler is OK.
return
a valid sound module in case of success or null in case of error.


                                                                                                                              
          

                                                                                       
        
                                                   
                                                    
        if (listener == null) {
            return null;
        }
        SoundTriggerModule module = new SoundTriggerModule(moduleId, listener, handler);
        return module;
    
public static native intlistModules(java.util.ArrayList modules)
Returns a list of descriptors for all harware modules loaded.

param
modules A ModuleProperties array where the list will be returned.
return
- {@link #STATUS_OK} in case of success - {@link #STATUS_ERROR} in case of unspecified error - {@link #STATUS_PERMISSION_DENIED} if the caller does not have system permission - {@link #STATUS_NO_INIT} if the native service cannot be reached - {@link #STATUS_BAD_VALUE} if modules is null - {@link #STATUS_DEAD_OBJECT} if the binder transaction to the native service fails