# Fixed size (or circular) sound buffer

**URL:** <https://qa.fmod.com/t/fixed-size-or-circular-sound-buffer/13642>\
**Category:** FMOD Engine\
**Created:** [January 15, 2018, 7:58pm UTC](https://qa.fmod.com/t/fixed-size-or-circular-sound-buffer/13642 "2018-01-15T19:58:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![acampoh](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@acampoh](https://qa.fmod.com/u/acampoh)\
**Post date:** [January 15, 2018, 7:58pm UTC](https://qa.fmod.com/t/fixed-size-or-circular-sound-buffer/13642/1 "2018-01-15T19:58:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [January 18, 2018, 5:00am UTC](https://qa.fmod.com/t/fixed-size-or-circular-sound-buffer/13642/2 "2018-01-18T05:00:15Z")

</div>

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](https://fmod.com/resources/documentation-api?page=content/generated/FMOD_MODE.html)
