Re: Noisy DefaultOutputUnit
Re: Noisy DefaultOutputUnit
- Subject: Re: Noisy DefaultOutputUnit
- From: Kurt Revis <email@hidden>
- Date: Sat, 26 Jan 2008 22:02:05 -0800
On Jan 26, 2008, at 9:36 PM, Paul Scott wrote:
I'd like to be able to turn off the callback routine without
sounding like I unplugged my guitar from the amp. Isn't there a
clean way to do this?
Fade your samples down to zero, or make sure you've been playing
zeroes, before you stop the output AU. Similarly, when starting the
AU, fade your samples up from zero.
In general, a "click" comes from a sudden discontinuous jump in sample
value. If you don't give the AU samples which are discontinuous, and
don't tell it to stop or start with non-zero samples, you should be
fine.
Let's imagine you have two buttons, one to start the audio and one
to stop. Your code would look like this:
...
But doesn't this cause the clicks? I really don't want the user to
have any clue as to when I attach or detach the audio unit.
That was just an example of how you'd start/stop the AU from a Cocoa
app, without messing with the run loop. Nothing to do with clicks
directly.
But definitely experiment! You probably won't break anything! (Until
the first time you play full-scale noise with your speakers turned up
all the way..)
--
Kurt Revis
email@hidden
_______________________________________________
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