public final class Equalizer extends Object
Equalizer amplification values are constrained to the range -20.0 Hz to 20.0 Hz,
see LibVlcConst.MIN_GAIN and LibVlcConst.MAX_GAIN. Attempting to
set values outside of this range will cause an IllegalArgumentException
to be thrown.
After creating an equalizer, it may be associated with a media player.
MediaPlayer.setEqualizer(Equalizer)| Constructor and Description |
|---|
Equalizer(int bandCount)
Create an audio equalizer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEqualizerListener(EqualizerListener listener)
Add a listener to be notified of equalizer state-change events.
|
float |
getAmp(int index)
Get an individual amplification value.
|
float[] |
getAmps()
Get the current amplification values for all frequency bands.
|
int |
getBandCount()
Get the number of distinct frequency bands in the equalizer.
|
float |
getPreamp()
Get the current pre-amplification value.
|
void |
removeEqualizerListener(EqualizerListener listener)
Remove a listener so that it is no longer notified of equalizer state-change
events.
|
void |
reset()
Reset all of the equalizer amplification values (including pre-amplification) to zero.
|
void |
setAmp(int index,
float newAmp)
Set an individual amplification value.
|
void |
setAmps(float[] newAmps)
Set new amplification values for all frequency bands.
|
void |
setEqualizer(Equalizer equalizer)
Set new amplification values (including pre-amplification) from another equalizer.
|
void |
setPreamp(float newPreamp)
Set a new pre-amplification value.
|
String |
toString() |
public Equalizer(int bandCount)
bandCount - number of unique frequency bands (not including pre-amp)public final void addEqualizerListener(EqualizerListener listener)
listener - listener to addpublic final void removeEqualizerListener(EqualizerListener listener)
listener - listener to removepublic final int getBandCount()
public final float getPreamp()
public final void setPreamp(float newPreamp)
newPreamp - pre-amplification value (Hz)IllegalArgumentException - if the amplification value is outside of the allowed rangepublic final float getAmp(int index)
index - index of the frequency band to getIllegalArgumentException - if the index is outside of the allowed rangepublic final void setAmp(int index,
float newAmp)
index - index of the frequency band to setnewAmp - amplification valueIllegalArgumentException - if the index or amplification value is outside of the allowed rangepublic final float[] getAmps()
public final void setAmps(float[] newAmps)
newAmps - new amplification valuesIllegalArgumentException - if the amplification values are null, the wrong length, or outside of the allowed rangepublic final void setEqualizer(Equalizer equalizer)
equalizer - equalizer to obtain values frompublic final void reset()
Copyright © 2009–2015 Caprica Software Limited. All rights reserved.