CoreAudio, Mixing and Panning, and the Audio Toolbox
CoreAudio, Mixing and Panning, and the Audio Toolbox
- Subject: CoreAudio, Mixing and Panning, and the Audio Toolbox
- From: Jonathan Feinberg <email@hidden>
- Date: Sat, 23 Feb 2002 19:40:10 -0500
I have written a small program that streams any number of audio files
to the default output device. I mix the audio data into the device's
buffer "manually", by looping through my ring buffers and scaling and
adding them into the device's buffer. It works well, and I'm excited
to have finally started getting something done in CoreAudio.
Ultimately, I'd like to stream arbitrary audio data into arbitrary
audio outputs, and I'd like to do so in a way that's internally clean
and efficient. I already know how I'd do that using the technique
I'm already using. However, I wonder whether I'd be better off using
the Audio Toolbox. I see that there's a stereo mixer Unit ('smxr').
This implies that you can associate a mixer unit with a physical
device, and feed your data to the Unit, letting it do the math for
panning and mixing. Is this indeed what it's for? If so, does there
exist any sample code that shows such a setup in use? Is there any
advantage to using the Audio Toolbox relative to rolling my own
scheme?
I have struggled through the "Audio Toolbox" chapter of the CoreAudio
pdf, and I see that there is a Java example which writes audio data
to a device via the default output unit, but I don't know how to put
those things together in such a way that you can combine the HAL and
Toolbox worlds.
To restate what I ultimately want: any number of independent
channels, each routed to a chosen physical device stream; when more
than one channel is associated with a stream, I wish to mix them.
Thanks, in advance, for whatever help and guidance you can provide.
--
Jonathan Feinberg email@hidden Inwood, NY, NY
http://MrFeinberg.com/
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.