B4J Library [B4j] AudioSpectrumVisualizer

This is the result of an interesting distraction. I came across this example which uses a Javafx AreaChart and the MediaPlayer AudioSpectrumListener to display an audio spectrum. I thought I would try porting it to B4j. It seems to work fairly well although I am not sure I really have a use for it, but someone might,

1660751952290.png
You can set the line, fill and background colours and colours for a gradient fill if required (as above)

There are no external dependencies.

It is a custom view in a b4xlib, feel free to unzip it if you want to see or play with the code, and a test project.
 

Attachments

  • AudioSpectrumVisualizer-b4xlib.b4xlib
    3.4 KB · Views: 259
  • AudioSpectrumVisualizer-Test.zip
    3 KB · Views: 227
Last edited:

stevel05

Expert
Licensed User
Longtime User
can it be adapted to b4a?
This one can't as it relies on the javafx media player. The Android Visualizer returns fft data which should be able to be used to achieve a similar effect. That library is 8 years old and I haven't used it since then. If you have any problems with it, let me know.
 

Similar Threads

Top