Hi,
This is my first post here.
Question/Issue:
I am trying to record some sounds with the ESP32 and an I2S microphone connected to it, but recorded is silence.
Project ID:
shmonov-project-1
Context/Use case:
My hardware details:
Dev board: ESP32-DevKit-LiPo with ESP32-WROOM-32UE MCU.
Microphone: Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H.
This is how it is wired:
.bck_io_num = 26, // BCKL → GPIO26
.ws_io_num = 32, // LRCL → GPIO32
.data_in_num = 33 // DOUT → GPIO33
I use there very pins because this is exactly how the mike is hooked up in the officially supported ESP-EYE board.
When I test this microphone with the following setup:
const i2s_config_t i2s_config = {
.mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX),
.sample_rate = 22050,
.bits_per_sample = I2S_BITS_PER_SAMPLE_32BIT, // could only get it to work with 32bits
.channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT,
.communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
.dma_buf_count = 4,
.dma_buf_len = 8
};
// The pin config as per the setup
const i2s_pin_config_t pin_config = {
.bck_io_num = 26, // BCKL
.ws_io_num = 32, // LRCL
.data_out_num = -1, // not used (only for speakers)
.data_in_num = 33 // DOUT
};
— I can see in Serial plotter that the microphone works fine.
But it doesn’t work if .bits_per_sample is set to something other than I2S_BITS_PER_SAMPLE_32BIT.
Is there any way to make my SPH0645 microphone work with Edge Studio IDE?
Any suggestions are welcome.
Thank you,
Alexander Shmonov