|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
EqualizerControl
is an audio EffectControl
for manipulating
the equalization settings of a Player
(s).
Equalizers (EQ) are usually used for two reasons: to compensate an unideal
frequency response of a system to make it sound more natural or
to create intentionally some unnatural coloring to the sound to create
an effect. The equalizer in this API serves both of these purposes.
This interface allows the sound source to be filtered with an equalizer. The equalizer can be set up in three different ways: using presets, using bass and treble controls, or by setting individual frequency bands by hand.
The preset settings can directly be
taken into use with the method setPreset
. The current preset can be
queried with the method getPreset
. If none of
the presets is set, null will be returned. null will also be returned
when a preset has been set, but the equalizer settings have been altered
later with setBandLevel
, setBass
, or setTreble
.
There are convenient methods,
setBass
and setTreble
, for altering the bass or treble only without
the need to specify any frequencies.
setBass
and setTreble
reset the current set-up
on the band in question (bass or treble frequencies respectively).
There are also methods for asking the current bass and treble
setting (getBass
and getTreble
),
but if the equalizer settings have been altered after
the bass and treble set-up by setting presets or altering
individual EQ-bands, the bass and treble settings are not anymore
unambiguously defined and EqualizerControl.UNDEFINED
will be returned.
There are also methods for getting and setting individual EQ-band
gains (setBandLevel
and getBandLevel
) and methods for asking the number of the
EQ-bands available (getNumberOfBands
) or their center frequencies
(getCenterFreq
). People who are more familiar with EQ
are able to create effects or to compensate the response of the system
with these methods.
The gains in this class are defined in millibels (hundredths of decibel), but it has to be understood that many devices contain a dynamic range control (DRC) system that will affect the actual effect and therefore, the value in millibels will affect as a guideline rather than as a strict rule.
Control
,
Player
Field Summary | |
static int |
UNDEFINED
|
Fields inherited from interface javax.microedition.amms.control.EffectControl |
SCOPE_LIVE_AND_RECORD, SCOPE_LIVE_ONLY, SCOPE_RECORD_ONLY |
Method Summary | |
int |
getBand(int frequency)
Gets the band that has the most effect on the given frequency. |
int |
getBandLevel(int band)
Gets the gain set for the given equalizer band. |
int |
getBass()
Gets the bass level. |
int |
getCenterFreq(int band)
Gets the center frequency of the given band. |
int |
getMaxBandLevel()
Returns the maximum band level supported. |
int |
getMinBandLevel()
Returns the minimum band level supported. |
int |
getNumberOfBands()
Gets the number of frequency bands that the equalizer supports. |
int |
getTreble()
Gets the treble level. |
void |
setBandLevel(int level,
int band)
Sets the given equalizer band to the given gain value. |
int |
setBass(int level)
Sets the bass level using a linear point scale with values between 0 and 100: a value of 0 applies the maximum available attenuation to frequencies in the bass band; a value of 50 gives a flat equalization of the bass band; and a value of 100 applies the maximum available amplification to frequencies in the bass band. |
int |
setTreble(int level)
Sets the treble level using a linear point scale with values between 0 and 100: a value of 0 applies the maximum available attenuation to frequencies in the treble band; a value of 50 gives a flat equalization of the treble band; and a value of 100 applies the maximum available amplification to frequencies in the treble band. |
Methods inherited from interface javax.microedition.amms.control.EffectControl |
getPreset, getPresetNames, getScope, isEnabled, isEnforced, setEnabled, setEnforced, setPreset, setScope |
Field Detail |
public static final int UNDEFINED
Method Detail |
public int getMinBandLevel()
public int getMaxBandLevel()
public void setBandLevel(int level, int band) throws java.lang.IllegalArgumentException
level
- the new gain in millibels that will be set to
the given band. getMinBandLevel() and getMaxBandLevel() will define
the maximum and minimum values.band
- the frequency band that will have the new gain.
The numbering of the bands starts from 0
and ends at (getNumberOfBands() - 1).
java.lang.IllegalArgumentException
- when the given band or level is
out of rangepublic int getBandLevel(int band) throws java.lang.IllegalArgumentException
band
- the frequency band whose gain is asked.
The numbering of the bands starts from 0
and ends at (getNumberOfBands() - 1).
java.lang.IllegalArgumentException
- when the given band is out of rangepublic int getNumberOfBands()
public int getCenterFreq(int band) throws java.lang.IllegalArgumentException
band
- the frequency band whose center frequency is asked.
The numbering of the bands starts from 0
and ends at (getNumberOfBands() - 1).
java.lang.IllegalArgumentException
- when the given band does not existpublic int getBand(int frequency)
frequency
- the frequency in milliHertz which is
to be equalized via the returned band
public int setBass(int level) throws java.lang.IllegalArgumentException
level
- the new level on a linear point scale that will be set to
the bass band
java.lang.IllegalArgumentException
- when the given level is below
0 or above 100public int setTreble(int level) throws java.lang.IllegalArgumentException
level
- the new level on a linear point scale that will be set to
the treble band
java.lang.IllegalArgumentException
- when the given level is below
0 or above 100public int getBass()
public int getTreble()
|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |