Hi, people. Doing a search for “AudioSampleBuffer” I just found 27 topics. None of them appears to explain the uses of this class deeply.
So I’m creating this topic to group important information about how does it works and how can we get things from AudioSampleBuffer in a common sense of the term buffer.
For example: is documented in Juce Documentation what happens if I read some block of data from an AudioSampleBuffer? I think not. In my (common) sense of the semantics of a buffer, data that had been read should be consumed, then the buffer should be freed from that data, just like a queue with a fixed size.
That is, I would expect that the older block just read was erased and the head pointer of the buffer should be incremented in just_read_block_size positions. In the other hand, the block just written into the buffer should be added starting from the num_allocated_samples position.
When the buffer was full, it would throw an exception or just let the programmer to control the buffer overflow himself.