Page 1 of 1

Implementation of analogSetPinAttenuation() function

Posted: Fri Mar 31, 2023 11:36 am
by BehicMV
Hi!
I'm currently working on ESP32-WROOM-32D and I'm trying to recording audio from I2S microphone with using "driver/i2s.h" library. I captured the audio. However the audio volume is extremely low. I researched many sites and I found the "analogSetPinAttenuation()" function. I implemented this function like this way:
  1.  analogSetPinAttenuation(mic_pin_config.data_in_num,  ADC_ATTEN_DB_0);
But I got this error:
  1. Compilation error: cannot convert 'adc_atten_t' to 'adc_attenuation_t' for argument '2' to 'void analogSetPinAttenuation(uint8_t, adc_attenuation_t)'

Any suggestion would be helpful.

Thanks in advance...

Re: Implementation of analogSetPinAttenuation() function

Posted: Sun Apr 02, 2023 1:18 am
by ESP_Sprite
The I2S microphone has the ADC internally and as such the signal arrives in digital form at the ESP32 side; messing with the ADC (analog* function calls) will do nothing as the internal ADC is not used.