public interface

IAudioEffect

implements IReleasable
com.h6ah4i.android.media.audiofx.IAudioEffect
Known Indirect Subclasses

Summary

Nested Classes
interface IAudioEffect.OnControlStatusChangeListener The OnControlStatusChangeListener interface defines a method called by the AudioEffect when a the control of the effect engine is gained or lost by the application  
interface IAudioEffect.OnEnableStatusChangeListener The OnEnableStatusChangeListener interface defines a method called by the AudioEffect when a the enabled state of the effect engine was changed by the controlling application. 
Constants
int ALREADY_EXISTS Internal operation status.
int ERROR Unspecified error.
int ERROR_BAD_VALUE Operation failed due to bad parameter value.
int ERROR_DEAD_OBJECT Operation failed due to dead remote object.
int ERROR_INVALID_OPERATION Operation failed because it was requested in wrong state.
int ERROR_NO_INIT Operation failed due to bad object initialization.
int ERROR_NO_MEMORY Operation failed due to lack of memory.
int SUCCESS Successful operation.
Public Methods
abstract boolean getEnabled()
Returns effect enabled state
abstract int getId()
Returns effect unique identifier.
abstract boolean hasControl()
Checks if this AudioEffect object is controlling the effect engine.
abstract void release()
Releases the native AudioEffect resources.
abstract void setControlStatusListener(IAudioEffect.OnControlStatusChangeListener listener)
Sets the listener AudioEffect notifies when the effect engine control is taken or returned.
abstract void setEnableStatusListener(IAudioEffect.OnEnableStatusChangeListener listener)
Sets the listener AudioEffect notifies when the effect engine is enabled or disabled.
abstract int setEnabled(boolean enabled)
Enable or disable the effect.
[Expand]
Inherited Methods
From interface com.h6ah4i.android.media.IReleasable

Constants

public static final int ALREADY_EXISTS

Internal operation status. Not returned by any method.

Constant Value: -2 (0xfffffffe)

public static final int ERROR

Unspecified error.

Constant Value: -1 (0xffffffff)

public static final int ERROR_BAD_VALUE

Operation failed due to bad parameter value.

Constant Value: -4 (0xfffffffc)

public static final int ERROR_DEAD_OBJECT

Operation failed due to dead remote object.

Constant Value: -7 (0xfffffff9)

public static final int ERROR_INVALID_OPERATION

Operation failed because it was requested in wrong state.

Constant Value: -5 (0xfffffffb)

public static final int ERROR_NO_INIT

Operation failed due to bad object initialization.

Constant Value: -3 (0xfffffffd)

public static final int ERROR_NO_MEMORY

Operation failed due to lack of memory.

Constant Value: -6 (0xfffffffa)

public static final int SUCCESS

Successful operation.

Constant Value: 0 (0x00000000)

Public Methods

public abstract boolean getEnabled ()

Returns effect enabled state

Returns
  • true if the effect is enabled, false otherwise.
Throws
IllegalStateException

public abstract int getId ()

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)

Returns
  • the effect identifier.
Throws
IllegalStateException

public abstract boolean hasControl ()

Checks if this AudioEffect object is controlling the effect engine.

Returns
  • true if this instance has control of effect engine, false otherwise.
Throws
IllegalStateException

public abstract void release ()

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.

Throws
IllegalStateException

public abstract void setControlStatusListener (IAudioEffect.OnControlStatusChangeListener listener)

Sets the listener AudioEffect notifies when the effect engine control is taken or returned.

Throws
IllegalStateException

public abstract void setEnableStatusListener (IAudioEffect.OnEnableStatusChangeListener listener)

Sets the listener AudioEffect notifies when the effect engine is enabled or disabled.

Throws
IllegalStateException

public abstract int setEnabled (boolean enabled)

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.

Parameters
enabled the requested enable state
Returns
Throws
IllegalStateException