• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Playing 2 or more audio data simultaneously
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Playing 2 or more audio data simultaneously


  • Subject: Re: Playing 2 or more audio data simultaneously
  • From: Bill Stewart <email@hidden>
  • Date: Wed, 18 Sep 2002 11:18:05 -0700

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.

References: 
 >Re: Playing 2 or more audio data simultaneously (From: Kurt Revis <email@hidden>)

  • Prev by Date: RE: Playing 2 or more audio data simultaneously
  • Next by Date: RE: Playing 2 or more audio data simultaneously
  • Previous by thread: Re: Playing 2 or more audio data simultaneously
  • Next by thread: Re: Playing 2 or more audio data simultaneously
  • Index(es):
    • Date
    • Thread