Deleting recording buffer

So the model is running and classifies correctly, however, if the classification is above .80 I’m performing certain actions (running google home) and then performing time.sleep(10). I noticed that it records whatever google home is saying and also records during sleep time. How can I delete whatever in the buffer after performing my actions?

Hi @Aisha,

What inference code are you using? Are you doing continuous keyword spotting or something else?

For continuous keyword spotting on most microcontrollers, the buffer is filling up in the background due to interrupts reading from the sensor and passing the data directly to memory via DMA. One option is to disable DMA during your sleep.

Another option is to avoid using sleep() altogether. Simply let the buffer fill, but ignore inference results until some time has passed.

Thanks for your reply, I’m working on Raspberry pi 4, sound classification. I will search about the suggestions you gave. Thanks