Roland,
Most of the CoreAudio examples under the SimpleSDK folder show you how to use the Default Output Unit, which is exactly what it sounds like, the system default output.
In your case you may be better off trying to use the AudioQueue API as others have suggested, it should make things a little easier. The concept is still the same though, you have to tell it what format it should expect the audio in and then provide the audio data in the way you told it you would.
Just to clarify, I wasn't suggesting that you write your own converter, but simply use the Apple supplied converter unit that converts between two formats that you specify. Defined in the documentation as follows:
AUConverter | kAudioUnitSubType_AUConverter
| A generic converter to handle data conversions within the linear PCM format. That is, it can handle sample rate conversions, integer to floating point conversions (and vice versa), interleaving, and so on. |
Good luck with your project! Peter
On Mar 27, 2008, at 12:59 PM, Roland Silver wrote: Peter, I appreciate your effort to help me! I have two problems with your suggestion, though. As an output unit I just want the standard output (if there is such a thing) that outputs to the Mac speakers (or stereo jack), but I don't know (1) how to specify that as output, or (2) what stream format it expects. If that format is something other than a series of doubles -- left[1], right[1], left[2], right[2] -- then I don't know how to write a converter for that, either!
Problem is that I'm (1) a composer (of music), and (2) just an old time C-programmer, trying to write a music composition program for my own peculiar purposes. I need some help to avoid having to learn more than is absolutely necessary to deal with this complex world of core audio, so I can finish my project and get on with creating actual music.
--RS
|