|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EqualizerControl
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()
|
|
int |
getMinBandLevel()
|
|
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 |
---|
static final int UNDEFINED
Method Detail |
---|
int getMinBandLevel()
the minimum band level in millibels
int getMaxBandLevel()
the maximum band level in millibels
void setBandLevel(int level, int band) throws 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).
IllegalArgumentException
- when the given band or level is
out of rangeint getBandLevel(int band) throws IllegalArgumentException
band
- @return the gain set for the given band in millibels
the frequency band whose gain is asked.
The numbering of the bands starts from 0
and ends at (getNumberOfBands() - 1).
IllegalArgumentException
- when the given band is out of rangeint getNumberOfBands()
int getCenterFreq(int band) throws IllegalArgumentException
band
- @return the center frequency in milliHertz
the frequency band whose center frequency is asked.
The numbering of the bands starts from 0
and ends at (getNumberOfBands() - 1).
IllegalArgumentException
- when the given band does not existint getBand(int frequency)
frequency
- @return the frequency band that has most effect on the given
frequency or -1 if no band has effect on the given frequencythe frequency in milliHertz which is
to be equalized via the returned bandint setBass(int level) throws IllegalArgumentException
level
- @return the level that was actually set
the new level on a linear point scale that will be set to
the bass band
IllegalArgumentException
- when the given level is below
0 or above 100int setTreble(int level) throws IllegalArgumentException
level
- @return the level that was actually set
the new level on a linear point scale that will be set to
the treble band
IllegalArgumentException
- when the given level is below
0 or above 100int getBass()
int getTreble()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal