• 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
Re: More Audio Unit Questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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?"
__________________________________________________________________________


References: 
 >More Audio Unit Questions (From: Brian Barnes <email@hidden>)

  • Prev by Date: Re: Has AudioUnits actually been tried in carbon?
  • Next by Date: Re: Set kAudioUnitProperty_StreamFormat seems to be broken
  • Previous by thread: More Audio Unit Questions
  • Next by thread: USBDeviceOpen eventually returns kIOReturnExclusiveAccess
  • Index(es):
    • Date
    • Thread