public class

OpenSLPresetReverb

extends Object
implements IAudioEffect IPresetReverb
java.lang.Object
   ↳ com.h6ah4i.android.media.opensl.audiofx.OpenSLPresetReverb

Summary

[Expand]
Inherited Constants
From interface com.h6ah4i.android.media.audiofx.IAudioEffect
From interface com.h6ah4i.android.media.audiofx.IPresetReverb
Public Constructors
OpenSLPresetReverb(OpenSLMediaPlayerContext context)
Public Methods
boolean getEnabled()
Returns effect enabled state
int getId()
Returns effect unique identifier.
short getPreset()
Gets current reverb preset.
IPresetReverb.Settings getProperties()
Gets the preset reverb properties.
boolean hasControl()
Checks if this AudioEffect object is controlling the effect engine.
void release()
Releases the native AudioEffect resources.
void setControlStatusListener(IAudioEffect.OnControlStatusChangeListener listener)
Sets the listener AudioEffect notifies when the effect engine control is taken or returned.
void setEnableStatusListener(IAudioEffect.OnEnableStatusChangeListener listener)
Sets the listener AudioEffect notifies when the effect engine is enabled or disabled.
int setEnabled(boolean enabled)
Enable or disable the effect.
void setParameterListener(IPresetReverb.OnParameterChangeListener listener)
Registers an OnParameterChangeListener interface.
void setPreset(short preset)
Enables a preset on the reverb.
void setProperties(IPresetReverb.Settings settings)
Sets the preset reverb properties.
Protected Methods
void finalize()
static void parseResultAndThrowExceptForIOExceptions(int result)
static void parseResultAndThrowException(int result)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.h6ah4i.android.media.IReleasable
From interface com.h6ah4i.android.media.audiofx.IAudioEffect
From interface com.h6ah4i.android.media.audiofx.IPresetReverb

Public Constructors

public OpenSLPresetReverb (OpenSLMediaPlayerContext context)

Public Methods

public boolean getEnabled ()

Returns effect enabled state

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

public 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.

public short getPreset ()

Gets current reverb preset.

Returns
  • the preset that is set at the moment.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public IPresetReverb.Settings getProperties ()

Gets the preset reverb properties. This method is useful when a snapshot of current preset reverb settings must be saved by the application.

Returns
  • a IPresetReverb.Settings object containing all current parameters values
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public 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 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.

public void setControlStatusListener (IAudioEffect.OnControlStatusChangeListener listener)

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

Throws
IllegalStateException

public void setEnableStatusListener (IAudioEffect.OnEnableStatusChangeListener listener)

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

Throws
IllegalStateException

public 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

public void setParameterListener (IPresetReverb.OnParameterChangeListener listener)

Registers an OnParameterChangeListener interface.

Parameters
listener OnParameterChangeListener interface registered

public void setPreset (short preset)

Enables a preset on the reverb.

The reverb PRESET_NONE disables any reverb from the current output but does not free the resources associated with the reverb. For an application to signal to the implementation to free the resources, it must call the release() method.

Parameters
preset this must be one of the the preset constants defined in this class. e.g. PRESET_SMALLROOM
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setProperties (IPresetReverb.Settings settings)

Sets the preset reverb properties. This method is useful when preset reverb settings have to be applied from a previous backup.

Parameters
settings a IPresetReverb.Settings object containing the properties to apply
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

Protected Methods

protected void finalize ()

Throws
Throwable

protected static void parseResultAndThrowExceptForIOExceptions (int result)

protected static void parseResultAndThrowException (int result)

Throws
IOException