/**@class android.media.audiofx.AudioEffect @extends java.lang.Object AudioEffect is the base class for controlling audio effects provided by the android audio framework. <p>Applications should not use the AudioEffect class directly but one of its derived classes to control specific effects: <ul> <li> {@link android.media.audiofx.Equalizer}</li> <li> {@link android.media.audiofx.Virtualizer}</li> <li> {@link android.media.audiofx.BassBoost}</li> <li> {@link android.media.audiofx.PresetReverb}</li> <li> {@link android.media.audiofx.EnvironmentalReverb}</li> <li> {@link android.media.audiofx.DynamicsProcessing}</li> </ul> <p>To apply the audio effect to a specific AudioTrack or MediaPlayer instance, the application must specify the audio session ID of that instance when creating the AudioEffect. (see {@link android.media.MediaPlayer#getAudioSessionId()} for details on audio sessions). <p>NOTE: attaching insert effects (equalizer, bass boost, virtualizer) to the global audio output mix by use of session 0 is deprecated. <p>Creating an AudioEffect object will create the corresponding effect engine in the audio framework if no instance of the same effect type exists in the specified audio session. If one exists, this instance will be used. <p>The application creating the AudioEffect object (or a derived class) will either receive control of the effect engine or not depending on the priority parameter. If priority is higher than the priority used by the current effect engine owner, the control will be transfered to the new object. Otherwise control will remain with the previous object. In this case, the new application will be notified of changes in effect engine state or control ownership by the appropriate listener. */ var AudioEffect = { /** UUID for environmental reverberation effect */ EFFECT_TYPE_ENV_REVERB : "null", /** UUID for preset reverberation effect */ EFFECT_TYPE_PRESET_REVERB : "null", /** UUID for equalizer effect */ EFFECT_TYPE_EQUALIZER : "null", /** UUID for bass boost effect */ EFFECT_TYPE_BASS_BOOST : "null", /** UUID for virtualizer effect */ EFFECT_TYPE_VIRTUALIZER : "null", /** UUID for Automatic Gain Control (AGC) */ EFFECT_TYPE_AGC : "null", /** UUID for Acoustic Echo Canceler (AEC) */ EFFECT_TYPE_AEC : "null", /** UUID for Noise Suppressor (NS) */ EFFECT_TYPE_NS : "null", /** UUID for Loudness Enhancer */ EFFECT_TYPE_LOUDNESS_ENHANCER : "null", /** UUID for Dynamics Processing */ EFFECT_TYPE_DYNAMICS_PROCESSING : "null", /** Null effect UUID. See {@link android.media.audiofx.AudioEffect(UUID, UUID, int, int)} for use. @hide */ EFFECT_TYPE_NULL : "null", /** State of an AudioEffect object that was not successfully initialized upon creation @hide */ STATE_UNINITIALIZED : "0", /** State of an AudioEffect object that is ready to be used. @hide */ STATE_INITIALIZED : "1", /** Event id for engine control ownership change notification. @hide */ NATIVE_EVENT_CONTROL_STATUS : "0", /** Event id for engine state change notification. @hide */ NATIVE_EVENT_ENABLED_STATUS : "1", /** Event id for engine parameter change notification. @hide */ NATIVE_EVENT_PARAMETER_CHANGED : "2", /** Successful operation. */ SUCCESS : "0", /** Unspecified error. */ ERROR : "-1", /** Internal operation status. Not returned by any method. */ ALREADY_EXISTS : "-2", /** Operation failed due to bad object initialization. */ ERROR_NO_INIT : "-3", /** Operation failed due to bad parameter value. */ ERROR_BAD_VALUE : "-4", /** Operation failed because it was requested in wrong state. */ ERROR_INVALID_OPERATION : "-5", /** Operation failed due to lack of memory. */ ERROR_NO_MEMORY : "-6", /** Operation failed due to dead remote object. */ ERROR_DEAD_OBJECT : "-7", /** Effect connection mode is insert. Specifying an audio session ID when creating the effect will insert this effect after all players in the same audio session. */ EFFECT_INSERT : "Insert", /** Effect connection mode is auxiliary. <p>Auxiliary effects must be created on session 0 (global output mix). In order for a MediaPlayer or AudioTrack to be fed into this effect, they must be explicitely attached to this effect and a send level must be specified. <p>Use the effect ID returned by {@link #getId}() to designate this particular effect when attaching it to the MediaPlayer or AudioTrack. */ EFFECT_AUXILIARY : "Auxiliary", /** Effect connection mode is pre processing. The audio pre processing effects are attached to an audio input (AudioRecord). @hide */ EFFECT_PRE_PROCESSING : "Pre Processing", /** Lock to protect listeners updates against event notifications @hide */ mListenerLock : "null", /** Handler for events coming from the native code @hide */ mNativeEventHandler : "null", /** Intent to launch an audio effect control panel UI. <p>The goal of this intent is to enable separate implementations of music/media player applications and audio effect control application or services. This will allow platform vendors to offer more advanced control options for standard effects or control for platform specific effects. <p>The intent carries a number of extras used by the player application to communicate necessary pieces of information to the control panel application. <p>The calling application must use the {@link android.app.Activity#startActivityForResult(Intent, int)} method to launch the control panel so that its package name is indicated and used by the control panel application to keep track of changes for this particular application. <p>The {@link #EXTRA_AUDIO_SESSION} extra will indicate an audio session to which the audio effects should be applied. If no audio session is specified, either one of the follownig will happen: <p>- If an audio session was previously opened by the calling application with {@link #ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION} intent, the effect changes will be applied to that session. <p>- If no audio session is opened, the changes will be stored in the package specific storage area and applied whenever a new audio session is opened by this application. <p>The {@link #EXTRA_CONTENT_TYPE} extra will help the control panel application customize both the UI layout and the default audio effect settings if none are already stored for the calling application. */ ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL : "android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL", /** Intent to signal to the effect control application or service that a new audio session is opened and requires audio effects to be applied. <p>This is different from {@link #ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL} in that no UI should be displayed in this case. Music player applications can broadcast this intent before starting playback to make sure that any audio effect settings previously selected by the user are applied. <p>The effect control application receiving this intent will look for previously stored settings for the calling application, create all required audio effects and apply the effect settings to the specified audio session. <p>The calling package name is indicated by the {@link #EXTRA_PACKAGE_NAME} extra and the audio session ID by the {@link #EXTRA_AUDIO_SESSION} extra. Both extras are mandatory. <p>If no stored settings are found for the calling application, default settings for the content type indicated by {@link #EXTRA_CONTENT_TYPE} will be applied. The default settings for a given content type are platform specific. */ ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION : "android.media.action.OPEN_AUDIO_EFFECT_CONTROL_SESSION", /** Intent to signal to the effect control application or service that an audio session is closed and that effects should not be applied anymore. <p>The effect control application receiving this intent will delete all effects on this session and store current settings in package specific storage. <p>The calling package name is indicated by the {@link #EXTRA_PACKAGE_NAME} extra and the audio session ID by the {@link #EXTRA_AUDIO_SESSION} extra. Both extras are mandatory. <p>It is good practice for applications to broadcast this intent when music playback stops and/or when exiting to free system resources consumed by audio effect engines. */ ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION : "android.media.action.CLOSE_AUDIO_EFFECT_CONTROL_SESSION", /** Contains the ID of the audio session the effects should be applied to. <p>This extra is for use with {@link #ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL}, {@link #ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION} and {@link #ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION} intents. <p>The extra value is of type int and is the audio session ID. @see android.media.MediaPlayer#getAudioSessionId() for details on audio sessions. */ EXTRA_AUDIO_SESSION : "android.media.extra.AUDIO_SESSION", /** Contains the package name of the calling application. <p>This extra is for use with {@link #ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION} and {@link #ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION} intents. <p>The extra value is a string containing the full package name. */ EXTRA_PACKAGE_NAME : "android.media.extra.PACKAGE_NAME", /** Indicates which type of content is played by the application. <p>This extra is for use with {@link #ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL} and {@link #ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION} intents. <p>This information is used by the effect control application to customize UI and select appropriate default effect settings. The content type is one of the following: <ul> <li>{@link #CONTENT_TYPE_MUSIC}</li> <li>{@link #CONTENT_TYPE_MOVIE}</li> <li>{@link #CONTENT_TYPE_GAME}</li> <li>{@link #CONTENT_TYPE_VOICE}</li> </ul> If omitted, the content type defaults to {@link #CONTENT_TYPE_MUSIC}. */ EXTRA_CONTENT_TYPE : "android.media.extra.CONTENT_TYPE", /** Value for {@link #EXTRA_CONTENT_TYPE} when the type of content played is music */ CONTENT_TYPE_MUSIC : "0", /** Value for {@link #EXTRA_CONTENT_TYPE} when the type of content played is video or movie */ CONTENT_TYPE_MOVIE : "1", /** Value for {@link #EXTRA_CONTENT_TYPE} when the type of content played is game audio */ CONTENT_TYPE_GAME : "2", /** Value for {@link #EXTRA_CONTENT_TYPE} when the type of content played is voice audio */ CONTENT_TYPE_VOICE : "3", /**Releases the native AudioEffect resources. It is a good practice to release the effect engine when not in use as control can be returned to other applications or the native resources released. */ release : function( ) {}, /**Get the effect descriptor. @see android.media.audiofx.AudioEffect.Descriptor @throws IllegalStateException */ getDescriptor : function( ) {}, /**Query all effects available on the platform. Returns an array of {@link android.media.audiofx.AudioEffect.Descriptor} objects @throws IllegalStateException */ queryEffects : function( ) {}, /**Query all audio pre-processing effects applied to the AudioRecord with the supplied audio session ID. Returns an array of {@link android.media.audiofx.AudioEffect.Descriptor} objects. @param {Number} audioSession system wide unique audio session identifier. @throws IllegalStateException @hide */ queryPreProcessings : function( ) {}, /**Checks if the device implements the specified effect type. @param {Object {UUID}} type the requested effect type. @return {Boolean} true if the device implements the specified effect type, false otherwise. @hide */ isEffectTypeAvailable : function( ) {}, /**Enable or disable the effect. Creating an audio effect does not automatically apply this effect on the audio source. It creates the resources necessary to process this effect but the audio signal is still bypassed through the effect engine. Calling this method will make that the effect is actually applied or not to the audio content being played in the corresponding audio session. @param {Boolean} enabled the requested enable state @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR_INVALID_OPERATION} or {@link #ERROR_DEAD_OBJECT} in case of failure. @throws IllegalStateException */ setEnabled : function( ) {}, /**Set effect parameter. The setParameter method is provided in several forms addressing most common parameter formats. This form is the most generic one where the parameter and its value are both specified as an array of bytes. The parameter and value type and length are therefore totally free. For standard effect defined by OpenSL ES, the parameter format and values must match the definitions in the corresponding OpenSL ES interface. @param {Object {byte[]}} param the identifier of the parameter to set @param {Object {byte[]}} value the new value for the specified parameter @return {Number} {@link #SUCCESS} in case of success, {@link #ERROR_BAD_VALUE}, {@link #ERROR_NO_MEMORY}, {@link #ERROR_INVALID_OPERATION} or {@link #ERROR_DEAD_OBJECT} in case of failure @throws IllegalStateException @hide */ setParameter : function( ) {}, /**Set effect parameter. The parameter and its value are integers. @see #setParameter(byte[], byte[]) @hide */ setParameter : function( ) {}, /**Set effect parameter. The parameter is an integer and the value is a short integer. @see #setParameter(byte[], byte[]) @hide */ setParameter : function( ) {}, /**Set effect parameter. The parameter is an integer and the value is an array of bytes. @see #setParameter(byte[], byte[]) @hide */ setParameter : function( ) {}, /**Set effect parameter. The parameter is an array of 1 or 2 integers and the value is also an array of 1 or 2 integers @see #setParameter(byte[], byte[]) @hide */ setParameter : function( ) {}, /**Set effect parameter. The parameter is an array of 1 or 2 integers and the value is an array of 1 or 2 short integers @see #setParameter(byte[], byte[]) @hide */ setParameter : function( ) {}, /**Set effect parameter. The parameter is an array of 1 or 2 integers and the value is an array of bytes @see #setParameter(byte[], byte[]) @hide */ setParameter : function( ) {}, /**Get effect parameter. The getParameter method is provided in several forms addressing most common parameter formats. This form is the most generic one where the parameter and its value are both specified as an array of bytes. The parameter and value type and length are therefore totally free. @param {Object {byte[]}} param the identifier of the parameter to set @param {Object {byte[]}} value the new value for the specified parameter @return {Number} the number of meaningful bytes in value array in case of success or {@link #ERROR_BAD_VALUE}, {@link #ERROR_NO_MEMORY}, {@link #ERROR_INVALID_OPERATION} or {@link #ERROR_DEAD_OBJECT} in case of failure. @throws IllegalStateException @hide */ getParameter : function( ) {}, /**Get effect parameter. The parameter is an integer and the value is an array of bytes. @see #getParameter(byte[], byte[]) @hide */ getParameter : function( ) {}, /**Get effect parameter. The parameter is an integer and the value is an array of 1 or 2 integers @see #getParameter(byte[], byte[]) In case of success, returns the number of meaningful integers in value array. @hide */ getParameter : function( ) {}, /**Get effect parameter. The parameter is an integer and the value is an array of 1 or 2 short integers @see #getParameter(byte[], byte[]) In case of success, returns the number of meaningful short integers in value array. @hide */ getParameter : function( ) {}, /**Get effect parameter. The parameter is an array of 1 or 2 integers and the value is also an array of 1 or 2 integers @see #getParameter(byte[], byte[]) In case of success, the returns the number of meaningful integers in value array. @hide */ getParameter : function( ) {}, /**Get effect parameter. The parameter is an array of 1 or 2 integers and the value is an array of 1 or 2 short integers @see #getParameter(byte[], byte[]) In case of success, returns the number of meaningful short integers in value array. @hide */ getParameter : function( ) {}, /**Get effect parameter. The parameter is an array of 1 or 2 integers and the value is an array of bytes @see #getParameter(byte[], byte[]) @hide */ getParameter : function( ) {}, /**Send a command to the effect engine. This method is intended to send proprietary commands to a particular effect implementation. In case of success, returns the number of meaningful bytes in reply array. In case of failure, the returned value is negative and implementation specific. @hide */ command : function( ) {}, /**Returns effect unique identifier. This system wide unique identifier can be used to attach this effect to a MediaPlayer or an AudioTrack when the effect is an auxiliary effect (Reverb) @return {Number} the effect identifier. @throws IllegalStateException */ getId : function( ) {}, /**Returns effect enabled state @return {Boolean} true if the effect is enabled, false otherwise. @throws IllegalStateException */ getEnabled : function( ) {}, /**Checks if this AudioEffect object is controlling the effect engine. @return {Boolean} true if this instance has control of effect engine, false otherwise. @throws IllegalStateException */ hasControl : function( ) {}, /**Sets the listener AudioEffect notifies when the effect engine is enabled or disabled. @param {Object {AudioEffect.OnEnableStatusChangeListener}} listener */ setEnableStatusListener : function( ) {}, /**Sets the listener AudioEffect notifies when the effect engine control is taken or returned. @param {Object {AudioEffect.OnControlStatusChangeListener}} listener */ setControlStatusListener : function( ) {}, /**Sets the listener AudioEffect notifies when a parameter is changed. @param {Object {AudioEffect.OnParameterChangeListener}} listener @hide */ setParameterListener : function( ) {}, /** @hide */ checkState : function( ) {}, /** @hide */ checkStatus : function( ) {}, /** @hide */ isError : function( ) {}, /** @hide */ byteArrayToInt : function( ) {}, /** @hide */ byteArrayToInt : function( ) {}, /** @hide */ intToByteArray : function( ) {}, /** @hide */ byteArrayToShort : function( ) {}, /** @hide */ byteArrayToShort : function( ) {}, /** @hide */ shortToByteArray : function( ) {}, /** @hide */ byteArrayToFloat : function( ) {}, /** @hide */ byteArrayToFloat : function( ) {}, /** @hide */ floatToByteArray : function( ) {}, /** @hide */ concatArrays : function( ) {}, };