Question/Issue:
Problems when using Arduino library of deployment
Project ID:
Context/Use case:
When i run audio classification directly as firmware flashed into the arduino nano rp2040 connect it works properly.
However when i try to implement it as an arduino library, the microphone continuos version, two things happen:
An #endif without an #if appears on end of code, in
ei_printf(“Predictions:\r\n”);
for (uint16_t i = 0; i < EI_CLASSIFIER_LABEL_COUNT; i++) {
ei_printf(" %s: ", ei_classifier_inferencing_categories[i]);
ei_printf("%.5f\r\n", result.classification[i].value);
}
//#endif
// Print anomaly result (if it exists)
#if EI_CLASSIFIER_HAS_ANOMALY == 1
ei_printf("Anomaly prediction: %.3f\r\n", result.anomaly);
#endif
}
#if !defined(EI_CLASSIFIER_SENSOR) || EI_CLASSIFIER_SENSOR != EI_CLASSIFIER_SENSOR_MICROPHONE
#error “Invalid model for current sensor.”
#endif
In the code provided, the #endif is commented to prevent that error, when commented what happens is the sample buffer seems to be overruned, it runs but it constantly gives:
16:46:29:991 → Error sample buffer overrun. Decrease the number of slices per model window EI_CLASSIFIER_SLICES_PER_MODEL_WINDOW is currently set to 3
16:46:29:991 → ERR: Failed to record audio…
16:46:31:061 → Error sample buffer overrun. Decrease the number of slices per model window EI_CLASSIFIER_SLICES_PER_MODEL_WINDOW is currently set to 3
I tried decreasing the slices per model windows to 1 but it didnt help