ESP32-A1S-AudioKit icon indicating copy to clipboard operation
ESP32-A1S-AudioKit copied to clipboard

How to detect the volume?

Open T-vK opened this issue 3 years ago • 0 comments

Is it possible to detect the volume of the line-in signal?

E.g. something like this?

#define LINE_IN_PIN A0;
void loop() {
    int sample = analogRead(LINE_IN_PIN);
    int volume = sample/4096*100; // volume in percent
    Serial.println(volume);
}

T-vK avatar Sep 21 '21 15:09 T-vK