-->
Page 1 of 1

vu-meter while playing audio file

PostPosted: Sat Mar 11, 2023 9:46 am
by Martinus
Hi,
I've been able to play a mp3 over a PCM5102 DAC using the lib at https://github.com/earlephilhower/ESP8266Audio - works well. Should be pretty easy to play any supported format.

However I want to display VU values somewhere (whatever the output is, a LCD screen or LEDs). For this I supposed I need access to N samples and compute an average. The question is, how do I get access to the samples values ?

My code is something very close to https://github.com/earlephilhower/ESP82 ... SPIFFS.ino (I'm using LittleFS instead of SPIFFS).

Regards,

Re: vu-meter while playing audio file

PostPosted: Wed Mar 22, 2023 2:18 am
by rooppoorali
You can add something like this to your project:
https://hackaday.io/project/4318/instructions

Re: vu-meter while playing audio file

PostPosted: Fri May 05, 2023 4:00 am
by eriksl
I think this project uses DMA to get the data to the I2S transmitter. This make stuff a bit more complex, but it's doable because the samples are "normal" main memory so still available to software.

I believe you should locate the code where one block of samples is completely decoded (to PCM) and a linked list entry is create to add it to the DMA engine. That's where you'll find the PCM samples.