Not a bug, just some questions for clarification from the edge-impulse developers.
code file: nano_ble33_sense_microphone.ino (any one)
Question1:
I see that, in the inference structure and PDM setup, a buffer size of 4096 for Pulse Density Modulation is being used.
...
setupPDM(4096)
..
Where as checking the source at https://github.com/arduino/ArduinoCore-nRF528x-mbedos/tree/master/libraries/PDM/src 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");
return;
}
But after checking out the static bool microphone_inference_record(void){}
I don’t see a return false
statement
/**
* @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) {
delay(10);
}
return true;
}
How come then we are checking for false?