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
}