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 14:32:58 -0400
- Thread-topic: Playing 2 or more audio data simultaneously
Yeah, but the problem with this example is that it is using a AudioFilePlay object (a player) which I can't use since we are doing shuttles with the audio data. I would need to fill all streams by myself in a callback or something like. I don't even know to to create streams.................
-----Original Message-----
From: Bill Stewart [
mailto:email@hidden]
Sent: Wednesday, September 18, 2002 2:18 PM
To: Kurt Revis; Robert Goulet
Cc: CoreAudio API
Subject: Re: Playing 2 or more audio data simultaneously
on 18/9/02 10:01 AM, Kurt Revis wrote:
>
On Wednesday, September 18, 2002, at 08:28 AM, Robert Goulet wrote:
>
>
> It is possible to mix sound with core audio? I'm currently able to
>
> play a single audio file because I don't understand how am I suppose
>
> to have more than one buffer in my output audio buffer list that I
>
> receive in my AudioIOProc.
>
>
This is not difficult at all; here's an overview. Use a mixer AudioUnit
>
to mix multiple audio streams into one stream. You set up an input
>
callback on the mixer, so it will ask you for data for each stream when
>
it needs it. On the output side, you can do two things:
>
>
1. Use one of the default audio output AudioUnits (see
>
AudioToolbox/DefaultAudioOutput.h). You can connect the mixer directly
>
to this, and your application won't need to implement an IO proc
>
anymore. This is definitely the easiest route.
Then....
The PlayAudioFile code has a path which plays the same file multiple times
(this uses a mixer unit and a separate bus for each version of the file to
play)
This would be easily modified to play a different file to each bus
Bill
>
2. Keep using the same IO proc that you're using now, but in it, ask
>
the mixer AU for data using AudioUnitRender() (or
>
AudioUnitRenderSlice() if the mixer AU is still a version-1 AU).
>
>
Despite what the other poster said, it's definitely not recommended to
>
set up more than one IO proc on the same output in the same
>
application. I think it works, but it will cost you CPU time and
>
increase the total load on the system, and will be confusing too.
>
>
Hope this helps.
>
>
--
>
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.
--
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
"...Been havin' some trouble lately in the sausage business," C.M.O.T.
Dibbler replied.
"What, having trouble making both ends meat?"
__________________________________________________________________________
_______________________________________________
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.