Re: Enable matrix mixer inputs without ramping
Re: Enable matrix mixer inputs without ramping
- Subject: Re: Enable matrix mixer inputs without ramping
- From: William Stewart <email@hidden>
- Date: Mon, 14 Dec 2009 19:36:09 -0800
On Dec 14, 2009, at 1:08 PM, Sean Dougall wrote:
Hi list,
Here's the simplified scenario: Our app routes playback of audio
files through matrix mixers, so that we can play back a number of
audio files, each channel of audio getting its own input bus on the
matrix mixer that feeds the output device.
Problem is, the app doesn't always have a lot of lead time (if any)
before an audio file starts playing, because it doesn't have a
strict DAW-style timeline. So it needs to be able to enable the
input bus immediately. What we're doing is:
err = AudioUnitSetParameter( _mixerUnit,
kMatrixMixerParam_Enable,
kAudioUnitScope_Input,
bus, // bus number getting passed in
flag, // YES when audio starts playing, NO when it stops
0 );
This is resulting in a quick but decidedly non-zero ramp time (on
the order of 10 ms),
Yes, the intention here is to ramp in a change to avoid clicks and
pops. If you are going to take care of it, then there are a couple of
different approaches. I think the most cost effective approach is to
have all of your input buses enabled that you think you need, then
have the input callbacks do one of two things:
(1) just return an error from the callback
- that should mean that the input is disregarded, and this is the
most efficient. If this doesn't work, then: (sometimes error handling
code is not quite correct)!
(2) memset the buffer to zero and set the ioSilence flag in the render
flags from the callback
- the mixers look at this flag and will not mix in audio that is
silent.
which causes playback artifacts in some cases. But we can't just
leave all the inputs enabled, because we can't predict ahead of time
how many inputs it'll need at any given time (and CPU usage gets
really hairy if we leave a generous enough number of inputs open).
I've tried using AudioUnitScheduleParameters() instead, but no love.
Is there a sensible way to immediately enable a mixer input?
No really, as the intention of the parameter is to handle clicks and
pops (both on enable and disable), so it will ramp regardless of what
you do.
Bill
_______________________________________________
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