Compatibility Issue: MEMS Microphone on ESP32 Outputs 32-bit Data, but Edge Impulse Algorithms Require 16-bit Data

Question/Issue:
Hi everyone,

I’m currently working on an audio project to identify Capercaillie sound (a kind of bird) using an ESP32 with a MEMS microphone. However, the algorithms imported from Edge Impulse seem to be designed for 16-bit input data. This has created a compatibility issue between the data format from the sensor and the expected input format of the model.

The MEMS microphone outputs 32-bit data, but the Edge Impulse algorithms are quantized to 16 bits. I’m unsure how to handle this mismatch in a way that minimizes performance loss or computational overhead.

We managed to run the algorithm but it is not at all as good as the test I did with my computer.

Project ID:
559493

Context/Use case:
I am trying to run the program on ESP32 2.0.4 with IDE Arduino 2.3.3

Thank you in advance for reading this and trying to help us,
Maureen

Hi @maureens

Let me check with @Arjan or @AIWintermuteAI if you can support scaling that by editing our firmware. Not entirely sure.

Best

Eoin

Thank you very much for your help !

Hi @maureens,

We indeed grab 16 bit samples of audio, but the input to the inference function requires float format. In the function microphone_audio_signal_get_data(size_t offset, size_t length, float *out_ptr) we convert int16_t to float, you can modify the code here (and of the inference.buffer) to be of type int32_t.