TAUBuffer circular?
TAUBuffer circular?
- Subject: TAUBuffer circular?
- From: Michael Hanna <email@hidden>
- Date: Sun, 13 Mar 2005 19:16:33 -0500
Is TAUBuffer a circular buffer? The reason I ask this is because in the
Delaystrom source that I'm examining, the mWriteIndex is initialized at
the end of the buffer:
public:
UniTapDelayKernel(AUEffectBase *inAudioUnit )
: AUKernelBase(inAudioUnit)
{
// Initialize per-channel state of this effect processor
mMaxDelayFrames = (int)(GetSampleRate() * kMaxDelayTime + 10)
/*a little extra so we can support full delay time*/;
mDelayBuffer.AllocateClear(mMaxDelayFrames);
mWriteIndex = mMaxDelayFrames - 1; // end of buffer
}
in ::Process
while (nSampleFrames-- > 0) {
Float32 input = *sourceP;
// write to delay line
mDelayBuffer[mWriteIndex] = input;
mWriteIndex = (mWriteIndex + 1) % mMaxDelayFrames;
int readIndex = NormalizeIndex(mWriteIndex - frames);
so it writes to mDelayBuffer at the last index, then increments it by
one.. if it weren't circular, it would write the sample out of bounds.
So is my assumption correct?
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden