• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
TAUBuffer circular?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: TAUBuffer circular?
      • From: stiwi <email@hidden>
  • Prev by Date: auval missing in my system
  • Next by Date: How to get feed samples to QT in realtime? (like CoreAudio)
  • Previous by thread: Re: auval missing in my system
  • Next by thread: Re: TAUBuffer circular?
  • Index(es):
    • Date
    • Thread