public class

StandardBassBoost

extends Object
implements IAudioEffect IBassBoost
java.lang.Object
   ↳ com.h6ah4i.android.media.standard.audiofx.StandardBassBoost

Summary

[Expand]
Inherited Constants
From interface com.h6ah4i.android.media.audiofx.IAudioEffect
From interface com.h6ah4i.android.media.audiofx.IBassBoost
Public Constructors
StandardBassBoost(int priority, int audioSession)
Public Methods
BassBoost getBassBoost()
Get underlying BassBoost instance.
boolean getEnabled()
Returns effect enabled state
int getId()
Returns effect unique identifier.
IBassBoost.Settings getProperties()
Gets the bass boost properties.
short getRoundedStrength()
Gets the current strength of the effect.
boolean getStrengthSupported()
Indicates whether setting strength is supported.
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(IBassBoost.OnParameterChangeListener listener)
Registers an OnParameterChangeListener interface.
void setProperties(IBassBoost.Settings settings)
Sets the bass boost properties.
void setStrength(short strength)
Sets the strength of the bass boost 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.IBassBoost

Public Constructors

public StandardBassBoost (int priority, int audioSession)

Throws
IllegalArgumentException
IllegalStateException
RuntimeException
UnsupportedOperationException

Public Methods

public BassBoost getBassBoost ()

Get underlying BassBoost instance.

Returns
  • underlying BassBoost instance.

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

public IBassBoost.Settings getProperties ()

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

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

public short getRoundedStrength ()

Gets the current strength of the effect.

Returns
  • the strength of the effect. The valid range for strength is [0, 1000], where 0 per mille designates the mildest effect and 1000 per mille the strongest
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

public boolean getStrengthSupported ()

Indicates whether setting strength is supported. If this method returns false, only one strength is supported and the setStrength() method always rounds to that value.

Returns
  • true is strength parameter is supported, false otherwise

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

Registers an OnParameterChangeListener interface.

Parameters
listener OnParameterChangeListener interface registered

public void setProperties (IBassBoost.Settings settings)

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

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

public void setStrength (short strength)

Sets the strength of the bass boost effect. If the implementation does not support per mille accuracy for setting the strength, it is allowed to round the given strength to the nearest supported value. You can use the getRoundedStrength() method to query the (possibly rounded) value that was actually set.

Parameters
strength strength of the effect. The valid range for strength strength is [0, 1000], where 0 per mille designates the mildest effect and 1000 per mille designates the strongest.
Throws
IllegalArgumentException
IllegalStateException
UnsupportedOperationException

Protected Methods

protected void checkIsNotReleased ()

protected void checkIsNotReleased (String methodName)

protected AudioEffect getAudioEffect ()

protected void workaroundPrevReleaseSync ()