[CLAM] Help with AudioCircularBuffer

Vegard Sandvold vegard.sandvold at notam02.no
Sat May 14 17:28:53 PDT 2005

Hi Xavier,

On Fri, May 13, 2005 12:08, Xavier Amatriain said:
> Could you give more details of what troubles you are running into? I.e.
> What configurations are you trying and what assertions you are getting.
> The AudioCircularBuffer is a "regular" circular buffer with phantom
> zone. The only rule here is that you need to write at least as many
> samples as you will read in every step and you need a buffer at least as
> large as the maximum number of unread samples that you will have. Also,
> the read index can never surpass the write index.

I did a more thorough inspection of my code, and discovered that I
actually wrote past the buffer size before I started reading any data,
i.e. causing the read index to surpass the write index. Problem solved by
increasing the buffer size slightly.

> Nevertheless, the AudioCircularBuffer is a class that can almost be
> marked as "deprecated" as we tend to use In and Outport for these
> purposes. That is why you can find no examples in the repository.

Winamp feeds my music analysis plugin with frame audio data through a
callback function. I use the circular buffer to aggregate enought data to
do a FFT of a reasonably sized frame. How do you suggest I use In and
Outport in this case?

And while I have you on the line; For the FFTs I want to have a 50% frame
overlap. Is it possible to rewind the read index of the circular buffer by
half a frame size? Without violating any assertions?


> El dv 13 de 05 del 2005 a les 10:03 +0200, en/na Vegard Sandvold va
> escriure:
>> Hi,
>> can someone on the clam team explain to me how to use the
>> AudioCircularBuffer object properly? I have tried different
>> configurations
>> of buffer sizes and read and write sizes, but I keep running into
>> assertion failures. There is no usage examples in the clam sources that
>> I
>> can find. Anyone?
>> Thanks!
>> Vegard
> --
> /**********************************
> ********* Xavier Amatriain ********
> ****** Music Technology Group *****
> ** IUA- Universitat Pompeu Fabra **
> ****** www.iua.upf.es/~xamat ******
> ***********************************/

More information about the clam-users mailing list