How would you go about playing MP3 from SD card, and displaying synchronized colour effects on neopixels? I'm thinking either volume or frequency (FFT) related.
I found this library - schreibfaul1/ESP32-audioI2S - very easy to achieve the first part (play MP3 from SD card), but I'm struggling with the second part; I don't think it allows to tap in to process the samples
I don't think I can write all the code from scratch myself (read from SD, decode MP3 etc), but if you could recommend libraries I could use, I think I would manage to scramble something together.
if possible, I would prefer to skip ADC, since I'm decoding MP3 on the ESP anyway (at least when using schreibfaul1/ESP32-audioI2S library). I did take a look at dfplayer, but I though it might be possible to do all on the ESP
I don't know anything about those libraries but once you've decoded the MP3 you have the audio samples and you should be able to pass them to FFT.
Of course FFT needs to know the sample rate and bit-depth. And if it's stereo the left & right samples will alternate so you'll have to deal with that.
Note that MP3 decoding is processor intensive and so are FFT and NeoPixels and I don't know if the ESP can do it all. The most important thing is that the audio samples come-out "smoothly" without interruption. (On a computer that's done with a buffer and as long as the the buffer doesn't run out of data the audio can flow-out constantly and evenly.)
With a DFplayer (or similar) the processor doesn't have access to the SD card or the digital audio data so you have to feed the analog back-into the ADC.
in a similar setup with an ESP32 I use a DFPlayer module as recommended by @kolaha in post 2 and the Adafruit_NeoPixel library (note that if you have more than 85 LEDs this library does not work with ESP32 Arduino Core 3.x and I have to use 2.0.17)