public final class AudioEqualizer extends Object
AudioEqualizer class provides audio equalization control for
a media player. It contains an ObservableList of EqualizerBand
elements. Each AudioEqualizer instance is connected to a
MediaPlayer and may be obtained using the
MediaPlayer.getAudioEqualizer method.MediaPlayer,
EqualizerBand| Type | Property and Description |
|---|---|
BooleanProperty |
enabled
Enables or disables
AudioEqualizer. |
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_NUM_BANDS
Maximum number of bands an
AudioEqualizer may contain. |
| Modifier and Type | Method and Description |
|---|---|
BooleanProperty |
enabledProperty()
Enables or disables
AudioEqualizer. |
ObservableList<EqualizerBand> |
getBands()
ObservableList containing
EqualizerBand elements. |
boolean |
isEnabled()
Gets the value of the property enabled.
|
void |
setEnabled(boolean value)
Sets the value of the property enabled.
|
public BooleanProperty enabledProperty
AudioEqualizer. If the enabled property
is set to false, AudioEqualizer settings are preserved but
not taken into account during playback, which is equivalent to setting all
EqualizerBand.gain properties to zero.trueisEnabled(),
setEnabled(boolean)public static final int MAX_NUM_BANDS
AudioEqualizer may contain.
In the current implementation this value is 64.public final ObservableList<EqualizerBand> getBands()
EqualizerBand elements. The content of
the sequence may be changed by adding or removing EqualizerBand
elements. When adding elements, the user must be prepared to catch
IllegalArgumentExceptions because
any change to the internal list can be vetoed
if a newly added instance is not valid.
The constraints for a valid EqualizerBand instance are:
EqualizerBand.centerFrequency > 0EqualizerBand.bandwidth > 0EqualizerBand.MIN_GAIN ≤
EqualizerBand.gain ≤
EqualizerBand.MAX_GAINThe default set of bands is as in the following table; all bands have unity gain (0 dB).
| Band Index | Center Frequency (Hz) | Bandwidth (Hz) |
|---|---|---|
| 0 | 32 | 19 |
| 1 | 64 | 39 |
| 2 | 125 | 78 |
| 3 | 250 | 156 |
| 4 | 500 | 312 |
| 5 | 1000 | 625 |
| 6 | 2000 | 1250 |
| 7 | 4000 | 2500 |
| 8 | 8000 | 5000 |
| 9 | 16000 | 10000 |
EqualizerBand elements.public final void setEnabled(boolean value)
AudioEqualizer. If the enabled property
is set to false, AudioEqualizer settings are preserved but
not taken into account during playback, which is equivalent to setting all
EqualizerBand.gain properties to zero.truepublic final boolean isEnabled()
AudioEqualizer. If the enabled property
is set to false, AudioEqualizer settings are preserved but
not taken into account during playback, which is equivalent to setting all
EqualizerBand.gain properties to zero.truepublic BooleanProperty enabledProperty()
AudioEqualizer. If the enabled property
is set to false, AudioEqualizer settings are preserved but
not taken into account during playback, which is equivalent to setting all
EqualizerBand.gain properties to zero.trueisEnabled(),
setEnabled(boolean)Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2019, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.