Unable to read I2S read data

Hello All,

I was trying record audio using INMP4441 and esp32s3. But I’m getting always fixed of 65535 and very rarely 0, I have checked all the connections and even tested with multimeter if their is wring issue but their is no wiring issue, May i know what would issue is their an setting I have to enable or I’m missing anything please do help me.

I use following code
#include <ESP_I2S.h>

I2SClass I2S;

void setup() {

Serial.begin(115200);

Serial.println(“I2S Microphone Initialized”);

  // Set up I2S in PDM RX mode

//I2S.setPins(42, 41);  // Change pins as per your setup

I2S.setPins(9, 43, -1, 10);

// Start the I2S in PDM RX mode with appropriate sample rate and bit width

if (!I2S.begin(I2S_MODE_STD, 16000, I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO)) {

    Serial.println("Failed to start I2S!");

    return;

}

Serial.println("I2S started!");

Serial.println(“I2S Microphone Initialized”);

delay(10000);

}

void loop() {

int32_t sample = 0;

// Check if data is available

if (I2S.available() > 0) {

sample = I2S.read(); // Read a sample

Serial.println(sample); // Print the audio sample

}

delay(10); // Adjust as needed for your application

}

Hi there,
And Welcome here.
SO can you edit your post and use the code tags above </> just paste it in there.
Improves readability and increases the chance of some quality response’s and good help.
more than likely you are using the newer BSP for the chip(mcu) and may need an older more compatible BSP for the older lib of the INMP4441.?
hth
GL :slight_smile: PJ :v: