Re: Playing 2 or more audio data simultaneously
Re: Playing 2 or more audio data simultaneously
- Subject: Re: Playing 2 or more audio data simultaneously
- From: Baron <email@hidden>
- Date: Wed, 18 Sep 2002 13:07:46 -0700
The buffers you get in your IOProc map out to the output hardware and are
provided by the output device. At the IOProc level all you can do is map
your discreet streams (channels) of data to specific hardware output
channels (1-n). You also have to provide the data in the format that the
device wants to get it. There is no mixing done at this level. Also, if you
want sound to be heard form the same device say as the Sound Manager, you
will have to listen for notifications that the default output device has
changed and then do the appropriate thing. The APIs at this level are not
designed as a playback mechanism like the Sound Manager.
It really sounds like you want to use AudioUnits for what you want to do.
Setting up the graph is not difficult and a lot of stuff gets taken care of
for you by outputting to the default output unit. If all the data you are
playing is the same format you don't even have to use an AudioConverter AU
to get your data to the correct format to pass on to the HAL. All you have
to do is tell the default output unit what format your are providing and it
will do the rest. If you are playing various formatted data, you can add an
AudioConverter to your graph (for each bus into the mixer).
Hope this is helpful.
Bob Aron
--
CoreAudio Team
Apple Computer Inc.
(408) 974-1221
>
Isn't any way to do it without using Audio Units? On that web page:
>
>
http://developer.apple.com/audio/xaudiooverview.html
>
>
...they say that CoreAudio supports multiple channel. Doesn't it means that it
>
can play those channels at the same time? Does the term channel mean audio
>
data stream? In the IOProc of CoreAudio, we receive a AudioBufferList where we
>
can copy the data into, so it get played on the sound card. How are we suppose
>
to control those AudioBuffers ? Can we add as much as we want? If yes, will
>
they play simultaneously in the case I fill them all in the IOProc?
>
>
If I can do it without using AudioUnits, it would be a lot easier since
>
AudioUnits seems to be used by high level implementations. I want to stay low
>
level so I can control every detail of the process. I really need help.
>
>
>
-----Original Message-----
>
From: Baron [mailto:email@hidden]
>
Sent: Wednesday, September 18, 2002 12:53 PM
>
To: Patrick Beard
>
Cc: CoreAudio mailing list (E-mail)
>
Subject: Re: Playing 2 or more audio data simultaneously
>
>
>
You can use AudioUnits and set up an AUGraph. Connect a mixer AU to the
>
default output unit and your good to go to mix as many busses (mixer inputs)
>
as you like. By outputting the mixer AU to the default output unit, your
>
sound will be directed to the same output hardware that would be used by the
>
Sound Manager. There is example code in the CoreAudio SDK
>
(http://developer.apple.com/audio/) or at
>
/Developer/Examples/CoreAudio/Services/ if you have the developer package
>
installed.
>
>
Bob Aron
_______________________________________________
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.