I once made an SPL Meter with an Arduino Uno and an analog SparkFun sound sensor.
You'd have to adapt it to the ESP32, calibrate for particular sound sensor, and possibly make other changes for your sensor. And, you'd need to add the code for the LEDs. (I send the dB values to the Serial Monitor.)