Change recording length from within audio model deployment

Hello!

I have an audio model deployment running wonderfully on my Arduino Nano 33, and I have two questions:

1: Prior to deployment, what defines how long the code will record (once deployed)? Is this taken from the window length in Edge Impulse?

2: How might one go about manually adjusting the length of recording from within the Arduino deployment? Having trouble figuring this out.

Thanks!

With some tinkering I found that if I manually increase n_samples in the microphone_inference_start() function, I can get longer record times. This seems to damage the classification though.

static bool microphone_inference_start(uint32_t n_samples)
{
  n_samples = 40000;
  // . . .
}

Hello @avielbr,

1: Prior to deployment, what defines how long the code will record (once deployed)? Is this taken from the window length in Edge Impulse?

What define the length is the frequency (number of samples per second).

2: How might one go about manually adjusting the length of recording from within the Arduino deployment? Having trouble figuring this out

Are the frequencies of your recording on your training set and the ones during the inference the same?

If not you can use sox to perform a downsampling and make sure that the two frequencies match:

I hope this helps,

Regards,

Louis

@avielbr The length is determined by the window length set on the Create Impulse screen. If you change it there (and your samples are long enough) you can just redeploy on Arduino and it’ll record longer.