Implementation of analogSetPinAttenuation() function

User avatar
BehicMV
Posts: 5
Joined: Fri Mar 31, 2023 11:20 am

Implementation of analogSetPinAttenuation() function

Postby BehicMV » Fri Mar 31, 2023 11:36 am

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...

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: Implementation of analogSetPinAttenuation() function

Postby ESP_Sprite » Sun Apr 02, 2023 1:18 am

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.

Who is online

Users browsing this forum: No registered users and 30 guests