Is there any way in Java / Android to open an MP3 or WAV file and from there get the sound waves constantly? according to its reproduction? and can from that constant return make your graphical representation?
Videowiththedesiredobjective: link
I already have an answer and several comments, I took a quick look at the libraries that were proposed just for curiosity, but unfortunately none of them really do what you seem to need: - (
Do not look for equalizer
an equalizer has the function of attenuating or emphasizing a specific frequency or a set of them (frequency band), you are looking for Audio spectrum Analyzer
each frame of processed audio is analyzed by < fourier transform is the magic.
I do not know java libraries, I just know how to do it, maybe explaining you can understand the steps needed.
Long ago I did this algorithm in python to test, in fact have some details on how you need the effect to be, the larger the window passed to fourier the lower the resolution order of the spectral components, but of course this has a computational cost and you will need to decide on a window size that is the best cost benefit for the your app.
The example you showed just by looking at the graph shows that it works very well with the low frequencies, but has almost no interaction with the treble, notice the minute 2:05 , a voice begins and the spectrum analyzer has almost no changes, this tells me that the algorithm is only demonstrating more serious frequency bands ...
There are two libraries that can do this for you: MiniEqualizer and
They have the same effect and if you look at their source code, you will see that they inherit from a View
In this case, you would have to synchronize View
with your Player
.