Take a look at:
http://lightshowpi.org/
Pick up the source code and see how they did it.
They also used FFT at the output of the wave, but in real time, and itโs not as slow as you think it works fine on Raspberry Pi.
Instead, they can switch to cosine conversion, since it happens faster, and this is what you would do if you would check the MP3 frames correctly, since MP3 is encoded with cosine conversion.
So, first you need to know which bit resembles frequencies in the real world.
Pypi.python.org now has direct AV or ffmpeg bindings that allow you to decode frame by frame, but I donโt know if you can extract freqs from objects representing frames, or you will have to convert to raw first as well.
If I were you, I would use the clean Python MP3 code you found to extract exactly what I need, optimizing it in the process. Using cython if necessary.
But this approach limits you to just MP3s. Lightshow Pi works with almost all compressed types.
Dalen source share