Forum Stats

  • 3,854,665 Users
  • 2,264,397 Discussions
  • 7,905,749 Comments

Discussions

How to make MediaPlayer catch specified ranges of audio spectrum

As title,I am not good at Physics,so I use JavaFX API to complete my audio visualizer,

but I can't find any clue in Java API,it just said that we may use bands,

https://docs.oracle.com/javafx/2/api/javafx/scene/media/MediaPlayer.html#audioSpectrumNumBandsProperty

Sadly if I want to catch 0~900 Hz , and make it be split into 64 bands,

the thing I can do just is player.setAudioSpectrumNumBands(1568) (because 22050 / 900 * 64) ,

but in AudioSpectrumListener,the calculation seems doesn't work because the amount of bands too big,

Is there any solution for this question?

Tagged:
This discussion has been closed.