Fixed size (or circular) sound buffer

Hello,

I’m trying to make a small voice controlled device with a raspberry (kind of homemade alexa / google home) and i was thinking on recording the voice with your library.

I’d like to have a fixed size buffer (for example 3 seconds of sound) where i can analyze and detect that somebody has said something before sending it to the corresponding service.

Is it posible to store the audio recorded on a kind of circular buffer so i can do something similar to my idea or does it sound like something a bit awful?

I’m open to all kind of ideas.

Thanks a lot,
Adrián

Download the FMODStudioAPI and check out the Record example included.
It uses a 1 second buffer to record to, which can be adjusted to your requirements, the function System::recordStart’s last parameter is a bool to control the looping behavior.

https://fmod.com/resources/documentation-api?page=content/generated/FMOD_MODE.html