You can find several audio spectrum displays / analyzers in the Internet which made LEDs dance to the beat of music. This project was inspired by one of them. It differs quite a bit from well know PLATINUMs - it has fully open source.
If you don't know what it actually do first check YouTube Showcase on Pyrograf channel, then continue reading.
Do it yourself https://www.instructables.com/Audio-Spectrum-Display-ASDV10-ESP32-399-WS2812B/