public interface AudioSpectrumListener
MediaPlayer
using MediaPlayer.setAudioSpectrumListener(javafx.scene.media.AudioSpectrumListener).MediaPlayer| Modifier and Type | Method and Description |
|---|---|
void |
spectrumDataUpdate(double timestamp,
double duration,
float[] magnitudes,
float[] phases)
Notifies the observer about new data available for the audio spectrum.
|
void spectrumDataUpdate(double timestamp,
double duration,
float[] magnitudes,
float[] phases)
The notification period for updates may be set using
MediaPlayer.setAudioSpectrumInterval(double), and the number of bands and
sensitivity threshold via MediaPlayer.setAudioSpectrumNumBands(int) and
MediaPlayer.setAudioSpectrumThreshold(int), respectively. The default
values of the settings are an interval of 0.1 seconds,
128 bands, and sensitivity threshold -60.0 dB.
The arrays passed to the listener should be considered to be read-only as the underlying implementation may re-use them.
timestamp - timestamp of the event in seconds.duration - duration for which the spectrum was computed in seconds.magnitudes - array containing the non-positive spectrum magnitude in decibels
(dB) for each band.
The size of the array equals the number of bands and should be considered
to be read-only.phases - array containing the phase in the range
[Math.PI, Math.PI] for each band.
The size of the array equals the number of bands and should be considered
to be read-only.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.