Some clarification questions related to exported Arduino Library (Audio classification)

Not a bug, just some questions for clarification from the edge-impulse developers.

code file: nano_ble33_sense_microphone.ino (any one)

I see that, in the inference structure and PDM setup, a buffer size of 4096 for Pulse Density Modulation is being used.


Where as checking the source at I see a defauklt default buffer size of 512 is enough to hold 256 16-bit samples (which is quite a lot).

So, why that high number of 4096 as buffer size?

Question 2:
In main loop, the below was used (if m was null/false etc.)

bool m = microphone_inference_record();
if (!m) {
    ei_printf("ERR: Failed to record audio...\n");

But after checking out the static bool microphone_inference_record(void){}
I don’t see a return false statement :thinking:

 * @brief      Wait on new data
 * @return     True when finished
static bool microphone_inference_record(void)
    inference.buf_ready = 0;
    inference.buf_count = 0;

    while(inference.buf_ready == 0) {

    return true;

How come then we are checking for false?

Hi @dattasaurabh82

You will need to ask on the Arduino forum as that is their code. Not sure why that would be used, it may be a bug you can report.



Also that code has been archived and looks unfinished so perhaps you will not get very far with it.



@Eoin are you referring to both the questions?

I thought the Arduino library and the associated examples are packaged by edge-impulse are exported from edge impulse. Are you saying that these Arduino examples were created in partnership with Arduino and so should be asked in Arduino forum?

I failed to mention that nano_ble33_sense_microphone.ino is one of the examples from any Arduino Library exported by Edge-Impulse.

So, shall the above question still be asked in Arduino Forum (depends on who developed them!)

1 Like

Sorry @dattasaurabh82 yes the second question is the one that is referring to a deactivated arduino example which we have no access or knowledge on. I suggest asking on:

We of course keep the Arduino library examples updated.

If there is any issue with one of our examples let me know and I’ll report it.