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: "Robert Goulet" <email@hidden>
- Date: Wed, 18 Sep 2002 15:29:31 -0400
- Thread-topic: Playing 2 or more audio data simultaneously
Well, you'll find me very annoying, but I will need a written example of how to proceed with that way since I'm unable to find a suitable, detailed doc. I think I can manage to create a mixer AU for each AudioDevice I found with the CoreAudio API. After, how do I make my IOProc works with mixer AU instead of writting data in the output buffer given in parameter? Then, when you talk about finding a mixer and an empty bus, I don't really understand what you mean or what it involve as code. I didn't find anything that talks about 'bus' in the doc. Then, using AudioUnitSetProperty() to set the input callback for that 'bus' is something I won't be able to do without an example code. And for that input callback, it totally don't get it.
I'm a Unix programmer, not a Mac programmer, so I'm still a newbie in that world full of components. I did OpenGL programming, QuickTime and some installation packages, and I didn't find that difficult... why is implementing audio on the Mac is that complicated? Nobody ever did a complex, professional audio tool on MacOS/X?
You could explain me a lot of things to do to get it working, but nothing will replace a good example code which would be very clear and comprehensible. I had the same problem when I did an implementation of audio on Mac using the SoundManager 2 year ago... (I wasn't able to find a clear and clean example of how to play multiple audio stream at the same time) And now, the same problem persist, unable to find an example of how to play multiple audio stream at the same time, without headache, patches and hacks.
-----Original Message-----
From: Kurt Revis [
mailto:email@hidden]
Sent: Wednesday, September 18, 2002 2:53 PM
To: Robert Goulet
Cc: CoreAudio mailing list (E-mail)
Subject: Re: Playing 2 or more audio data simultaneously
On Wednesday, September 18, 2002, at 11:21 AM, Robert Goulet wrote:
>
[I currently have an implementation of CoreAudio. When the application
>
starts, I query the system to get how many AudioDevice are present,
>
and I keep them for future references.] Our application work like > this:
>
>
You can add an audio file to the scene (this is a multimedia
>
application that works with 3D animations, videos, etc.), and then,
>
you can specify a destination to that audio clip. The destination
>
defines on which sound card the sound will output. Then the user can
>
add more audio clips and set the same destination for all of them.
>
>
What would be the easiest modification of that program so I could play
>
multiple file simultaneously?
I've already explained some of this, but very roughly:
* In your setup code, create a mixer AudioUnit for each possible output.
* You already have one IOProc for each output. Change this IOProc to
take data from the mixer, instead of from a file.
* When you start playing a sound, find the mixer to use, and find an
empty bus. (It's up to you to remember which buses are in use.)
* Using AudioUnitSetProperty(), set an input callback on the mixer for
that bus.
* Implement the input callback to get the data from the file and return
it.
There may be other ways to do this (for instance, you might be able to
create the mixers on the fly instead of all at once), but this will
work.
--
Kurt Revis
email@hidden
_______________________________________________
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.