Anyway to log inferences to SD card?

I would like to log the inferences to an SD card but I need to also get the input data that is being used to do the inference. This is where I’m having trouble. How can I do this? I already have the SD card wired up but I can’t seem to get the proper output. I’m doing audio classification using the Arduino nano BLE sense.

@bwolfram1 if you export to Arduino library you get access to the nano_ble33_sense_microphone sketch which provides a minimalistic standalone example. Here you can add your logic after the call to run_classifier()

1 Like

To add to @yodaimpulse in continuous audio mode (microphone_continuous sketch) you’ll get slices of data (e.g. 250ms or 333ms depending on the device), which you can conveniently just append to a file (the data is in inference.buffers[inference.buf_select]). If you write a WAV file header first to the file then you can just keep appending this buffer. When you’re done, update the length of the content in the header and done, you’ll have a playable WAV file on the SD card.