java.lang.Object | |
↳ | com.h6ah4i.android.media.standard.audiofx.StandardEqualizer |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.h6ah4i.android.media.audiofx.IAudioEffect
| |||||||||||
From interface
com.h6ah4i.android.media.audiofx.IEqualizer
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
StandardEqualizer(int priority, int audioSession) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
short |
getBand(int frequency)
Gets the band that has the most effect on the given frequency.
| ||||||||||
int[] | getBandFreqRange(short band) | ||||||||||
short |
getBandLevel(short band)
Gets the gain set for the given equalizer band.
| ||||||||||
short[] |
getBandLevelRange()
Gets the level range for use by
setBandLevel(short, short) . | ||||||||||
int |
getCenterFreq(short band)
Gets the center frequency of the given band.
| ||||||||||
short |
getCurrentPreset()
Gets current preset.
| ||||||||||
boolean |
getEnabled()
Returns effect enabled state
| ||||||||||
Equalizer |
getEqualizer()
Get underlying Equalizer instance.
| ||||||||||
int |
getId()
Returns effect unique identifier.
| ||||||||||
short |
getNumberOfBands()
Gets the number of frequency bands supported by the Equalizer engine.
| ||||||||||
short |
getNumberOfPresets()
Gets the total number of presets the equalizer supports.
| ||||||||||
String |
getPresetName(short preset)
Gets the preset name based on the index.
| ||||||||||
IEqualizer.Settings |
getProperties()
Gets the equalizer properties.
| ||||||||||
boolean |
hasControl()
Checks if this AudioEffect object is controlling the effect engine.
| ||||||||||
void |
release()
Releases the native AudioEffect resources.
| ||||||||||
void |
setBandLevel(short band, short level)
Sets the given equalizer band to the given gain value.
| ||||||||||
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(IEqualizer.OnParameterChangeListener listener)
Registers an OnParameterChangeListener interface.
| ||||||||||
void |
setProperties(IEqualizer.Settings settings)
Sets the equalizer properties.
| ||||||||||
void |
usePreset(short preset)
Sets the equalizer according to the given preset.
|
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.IEqualizer
|
IllegalArgumentException | |
---|---|
IllegalStateException | |
RuntimeException | |
UnsupportedOperationException |
Gets the band that has the most effect on the given frequency.
frequency | frequency in milliHertz which is to be equalized via the returned band. |
---|
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Gets the gain set for the given equalizer band.
band | frequency band whose gain is requested. The numbering of the bands starts from 0 and ends at (number of bands - 1). |
---|
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Gets the level range for use by setBandLevel(short, short)
. The
level is expressed in milliBel.
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Gets the center frequency of the given band.
band | frequency band whose center frequency is requested. The numbering of the bands starts from 0 and ends at (number of bands - 1). |
---|
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Gets current preset.
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Returns effect enabled state
IllegalStateException |
---|
Get underlying Equalizer instance.
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)
IllegalStateException |
---|
Gets the number of frequency bands supported by the Equalizer engine.
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Gets the total number of presets the equalizer supports. The presets will have indices [0, number of presets-1].
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Gets the preset name based on the index.
preset | index of the preset. The valid range is [0, number of presets-1]. |
---|
Gets the equalizer properties. This method is useful when a snapshot of current equalizer settings must be saved by the application.
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Checks if this AudioEffect object is controlling the effect engine.
IllegalStateException |
---|
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.
Sets the given equalizer band to the given gain value.
band | frequency band that will have the new gain. The numbering of the bands starts from 0 and ends at (number of bands - 1). |
---|---|
level | new gain in millibels that will be set to the given band. getBandLevelRange() will define the maximum and minimum values. |
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Sets the listener AudioEffect notifies when the effect engine control is taken or returned.
IllegalStateException |
---|
Sets the listener AudioEffect notifies when the effect engine is enabled or disabled.
IllegalStateException |
---|
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.
enabled | the requested enable state |
---|
SUCCESS
in case of success,
ERROR_INVALID_OPERATION
or ERROR_DEAD_OBJECT
in
case of failure.IllegalStateException |
---|
Registers an OnParameterChangeListener interface.
listener | OnParameterChangeListener interface registered |
---|
Sets the equalizer properties. This method is useful when equalizer settings have to be applied from a previous backup.
settings | an IEqualizer.Settings object containing the properties to apply |
---|
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |
Sets the equalizer according to the given preset.
preset | new preset that will be taken into use. The valid range is [0, number of presets-1]. |
---|
IllegalArgumentException | |
---|---|
IllegalStateException | |
UnsupportedOperationException |