public class

StandardEnvironmentalReverb

extends Object
implements IAudioEffect IEnvironmentalReverb
java.lang.Object
   ↳ com.h6ah4i.android.media.standard.audiofx.StandardEnvironmentalReverb

Summary

Constants
String TAG
[Expand]
Inherited Constants
From interface com.h6ah4i.android.media.audiofx.IAudioEffect
From interface com.h6ah4i.android.media.audiofx.IEnvironmentalReverb
Public Constructors
StandardEnvironmentalReverb(int priority, int audioSession)
Public Methods
short getDecayHFRatio()
Gets the ratio of high frequency decay time (at 5 kHz) relative to low frequencies.
int getDecayTime()
Gets the decay time.
short getDensity()
Gets the density level.
short getDiffusion()
Gets diffusion level.
boolean getEnabled()
Returns effect enabled state
EnvironmentalReverb getEnvironmentalReverb()
Get underlying EnvironmentalReverb instance.
int getId()
Returns effect unique identifier.
IEnvironmentalReverb.Settings getProperties()
Gets the environmental reverb properties.
int getReflectionsDelay()
Gets the reflections delay.
short getReflectionsLevel()
Gets the volume level of the early reflections.
int getReverbDelay()
Gets the reverb delay.
short getReverbLevel()
Gets the reverb level.
short getRoomHFLevel()
Gets the room HF level.
short getRoomLevel()
Gets the master volume level of the environmental reverb effect.
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 setDecayHFRatio(short decayHFRatio)
Sets the ratio of high frequency decay time (at 5 kHz) relative to the decay time at low frequencies.
void setDecayTime(int decayTime)
Sets the time taken for the level of reverberation to decay by 60 dB.
void setDensity(short density)
Controls the modal density of the late reverberation decay.
void setDiffusion(short diffusion)
Sets the echo density in the late reverberation decay.
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(IEnvironmentalReverb.OnParameterChangeListener listener)
Registers an OnParameterChangeListener interface.
void setProperties(IEnvironmentalReverb.Settings settings)
Sets the environmental reverb properties.
void setReflectionsDelay(int reflectionsDelay)
Sets the delay time for the early reflections.
void setReflectionsLevel(short reflectionsLevel)
Sets the volume level of the early reflections.
void setReverbDelay(int reverbDelay)
Sets the time between the first reflection and the reverberation.
void setReverbLevel(short reverbLevel)
Sets the volume level of the late reverberation.
void setRoomHFLevel(short roomHF)
Sets the volume level at 5 kHz relative to the volume level at low frequencies of the overall reverb effect.
void setRoomLevel(short room)
Sets the master volume level of the environmental reverb effect.
Protected Methods
void checkIsNotReleased()
void checkIsNotReleased(String methodName)
AudioEffect getAudioEffect()
void workaroundPrevReleaseSync()
[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.IEnvironmentalReverb

Constants

public static final String TAG

Constant Value: "StdEnvReverb"

Public Constructors

public StandardEnvironmentalReverb (int priority, int audioSession)

Throws
IllegalArgumentException
IllegalStateException
RuntimeException
UnsupportedOperationException

Public Methods

public short getDecayHFRatio ()

Gets the ratio of high frequency decay time (at 5 kHz) relative to low frequencies.

Returns
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public int getDecayTime ()

Gets the decay time.

Returns
  • the decay time in milliseconds.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public short getDensity ()

Gets the density level.

Returns
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public short getDiffusion ()

Gets diffusion level.

Returns
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public boolean getEnabled ()

Returns effect enabled state

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

public EnvironmentalReverb getEnvironmentalReverb ()

Get underlying EnvironmentalReverb instance.

Returns
  • underlying EnvironmentalReverb instance.

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.
Throws
IllegalStateException

public IEnvironmentalReverb.Settings getProperties ()

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

Returns
  • an IEnvironmentalReverb.Settings object containing all current parameters values
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public int getReflectionsDelay ()

Gets the reflections delay.

Returns
  • the early reflections delay in milliseconds.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public short getReflectionsLevel ()

Gets the volume level of the early reflections.

Returns
  • the early reflections level in millibels.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public int getReverbDelay ()

Gets the reverb delay.

Returns
  • the reverb delay in milliseconds.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public short getReverbLevel ()

Gets the reverb level.

Returns
  • the reverb level in millibels.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public short getRoomHFLevel ()

Gets the room HF level.

Returns
  • the room HF level in millibels.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public short getRoomLevel ()

Gets the master volume level of the environmental reverb effect.

Returns
  • the room level in millibels.
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 setDecayHFRatio (short decayHFRatio)

Sets the ratio of high frequency decay time (at 5 kHz) relative to the decay time at low frequencies.

Parameters
decayHFRatio high frequency decay ratio using a permille scale. The valid range is [100, 2000]. A ratio of 1000 indicates that all frequencies decay at the same rate.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setDecayTime (int decayTime)

Sets the time taken for the level of reverberation to decay by 60 dB.

Parameters
decayTime decay time in milliseconds. The valid range is [100, 20000].
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setDensity (short density)

Controls the modal density of the late reverberation decay.

The scale should approximately map linearly to the perceived change in reverberation. A lower density creates a hollow sound that is useful for simulating small reverberation spaces such as bathrooms.

Parameters
density density specified using a permille scale. The valid range is [0, 1000]. A value of 1000 o/oo indicates a natural sounding reverberation. Values below this level produce a more colored effect.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setDiffusion (short diffusion)

Sets the echo density in the late reverberation decay.

The scale should approximately map linearly to the perceived change in reverberation.

Parameters
diffusion diffusion specified using a permille scale. The diffusion valid range is [0, 1000]. A value of 1000 o/oo indicates a smooth reverberation decay. Values below this level give a more grainy character.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

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 (IEnvironmentalReverb.OnParameterChangeListener listener)

Registers an OnParameterChangeListener interface.

Parameters
listener OnParameterChangeListener interface registered

public void setProperties (IEnvironmentalReverb.Settings settings)

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

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

public void setReflectionsDelay (int reflectionsDelay)

Sets the delay time for the early reflections.

This method sets the time between when the direct path is heard and when the first reflection is heard.

Parameters
reflectionsDelay reflections delay in milliseconds. The valid range is [0, 300].
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setReflectionsLevel (short reflectionsLevel)

Sets the volume level of the early reflections.

This level is combined with the overall room level (set using setRoomLevel(short)).

Parameters
reflectionsLevel reflection level in millibels. The valid range is [-9000, 1000].
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setReverbDelay (int reverbDelay)

Sets the time between the first reflection and the reverberation.

Parameters
reverbDelay reverb delay in milliseconds. The valid range is [0, 100].
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setReverbLevel (short reverbLevel)

Sets the volume level of the late reverberation.

This level is combined with the overall room level (set using setRoomLevel(short)).

Parameters
reverbLevel reverb level in millibels. The valid range is [-9000, 2000].
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setRoomHFLevel (short roomHF)

Sets the volume level at 5 kHz relative to the volume level at low frequencies of the overall reverb effect.

This controls a low-pass filter that will reduce the level of the high-frequency.

Parameters
roomHF high frequency attenuation level in millibels. The valid range is [-9000, 0].
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public void setRoomLevel (short room)

Sets the master volume level of the environmental reverb effect.

Parameters
room room level in millibels. The valid range is [-9000, 0].
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

Protected Methods

protected void checkIsNotReleased ()

protected void checkIsNotReleased (String methodName)

protected AudioEffect getAudioEffect ()

protected void workaroundPrevReleaseSync ()