Re: More Audio Unit Questions
Re: More Audio Unit Questions
- Subject: Re: More Audio Unit Questions
- From: Bill Stewart <email@hidden>
- Date: Sat, 29 Sep 2001 15:15:15 -0700
On Thursday, September 27, 2001, at 08:24 AM, Brian Barnes wrote:
Alright, more questions even before the first are answered. Once
again,
any information given to me I'll redistribute through some sample code,
hopefully saving you a little work.
1. Stopping a sample in the callback.
OK, I am playing a sample on an audio unit. In the callback for
data, I
run out of samples. I fill the rest with 0's and wait for the next
callback, where I need to stop the audiounit. Can I call
AudioOutputUnitStop IN the callback? Or is there some other way to do
it?
You can - but then you stop whatever the AU is outputting too. If
you're running out of data you need to deal with that in your code
and perhaps buffer ahead...
For eg. stopping an audio unit outputing to a device is going to
give you glitches in the audio you're outputting...
2. AudioUnit's in stopped positions -- I assume they take up no
processing time, correct?
Yep.
3. Effects.
3a. This is the main reason I'm moving to audio units. I'd like
to have
a changing reverb as you go through different sized rooms. I
assume the
procedure is that you hook up all your audio units (playing samples) to
the input of a effect/reverb. Here's where I have a problem. Can the
output of the effect go right to the speaker, or do I have to funnel
that output to another audio unit that is output?
You connect the output of your reverb as an input to an
AudioDeviceOutputUnit and that gets it to the speakers.
3b. Let's say I want to turn off reverb (you go outside). Is there a
way to set the effects unit to just become a pass-through, or is it
worth the trouble to go through all the audio units I have and
reconnect
them to the regular output (and then connect them back to turn it on.)
That seems a bit costly. Especially as I want to have other effects
inline that I can turn on and off.
Why not just turn it off - all that your unit would do is pass the
input buffer it gets straight through...
4. This "AudioConverter" that's coming in 10.1, will that allow me an
easy way to bring AIFFs into the fp format for your buffers? I can
always use ParseAIFFHeader and then divide out the samples to get the
correct floats, but I'd rather have you do it for me!
You'll still need to use the ParseAIFFHeader call to get the data
from the AIF file (its format, etc)... We're working on a CoreAudio
version of this call...
In the DefaultOutput code in the Java directory of 10.1 there's an
example of using this call to get the format of the AIF file, read
the data from it and give that to an AudioConverter that you've set
up with the data from the ParseAIFF call.
There's also a complete access to all of the structures of the AIFF
format in AIFF.h (in Carbon)
Bill
That's all for now, more later.
[>] Brian
_______________________________________________
coreaudio-api mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
Cat: "Leave me alone, I'm trying to nap... Ah, What's that clicking
noise?"
__________________________________________________________________________