ESP32 & INMP441

Hi everyone,

this is my first post in the community, I’m getting started with beehive audio analysis. I’m starting with INMP441 digital 24 bit microphone and ESP32 will be sampled at 44100

Is this a good place to begin with or should the sampling rate be higher?
Can anyone suggest any I2S library for easy integration ?

Almost every I2S integration codes that i have seen so far seem to have used only 16 bits & they don’t seem to display raw data instead a mean is calculated and that is displayed.

can someone show me a direction here to proceed further, I’m kinda stuck. thanks.

Are you looking to record sound files or gather frequently and amplitude data? If the former I’d take a look at this library, I’ve tested it with the INMP411.

2 Likes

I’m looking to collect sound data, but the problem with Shea Ivy’s code is that it only collects 1024 samples at a time. I’ve managed to work around that and modify it, but when I collect audio data for a minute (60 seconds) at:

@44.1KHz:
44100 * 60 = 2,646,000 samples
For 32-bit:
2,646,000 * 4 = 10,584,000 bytes (~10MB)

@16KHz:
16,000 * 60 = 960,000 samples
For 32-bit:
960,000 * 4 = 3,840,000 bytes (~3.8MB)

The ESP32 WROOM 32 has 512KB of RAM, with roughly 300KB available for use.
300,000 / 4 = 76,800 samples

So:
@44.1KHz: 76,800 / 44,100 = 1.74 seconds
@16KHz: 76,800 / 16,000 = 4.8 seconds

What should I do? If I save every 1.5 seconds, there may be data loss between clips, which could degrade the quality of the data.

I was thinking of adding a double buffer or ring buffer to solve the problem, but I’m still unsure about potential data loss and its impact. How do you typically handle this? Do you use a different microcontroller, or am I missing something?