• 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 multiple sounds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Playing multiple sounds


  • Subject: Re: Playing multiple sounds
  • From: Stephen Davis <email@hidden>
  • Date: Sat, 25 Aug 2007 10:09:51 -0700

On Aug 25, 2007, at 4:26 AM, Andreas Falkenhahn wrote:

Ok, thanks. I've now successfully installed a render callback on
the mixer.
But now there's a new problem: When the render proc is called,
ioData->mNumberBuffers
is 2 now, which makes AudioConverterFillComplexBuffer() exit with a
paramErr
because it obviously expects only one buffer.

What am I doing wrong here?

The format is mismatched - the version 1 AUs (that you were using)
were using interleaved floats. The format for v2 units use
deinterleaved floats. Have a look at the SetCanonical call in
CAStreamBasicDescription.cpp (in PublicUtility in /Developer/ Examples/
CoreAudio)

Ok, thanks. Now it's playing correctly. But: Am I not somewhat overriding
the user's default settings by applying SetCanonical() on the default output
format gotten through AudioUnitGetProperty()? I'm just wondering because
SetCanonical() sets mBitsPerChannel to 32, mChannelsPerFrame to 2,
BytesPerFrame to sizeof(Float32), etc.


Why do I need to get the default stream format at all then if I'm overriding it
with my own settings (using SetCanonical) right after I got it?

I think Bill's point was merely that deinterleaved audio is now the default for v2 audio units and that SetCanonical() shows you how it's done. You can still set the format to something different as long as you keep in mind that it should be deinterleaved. Certain audio units (default output units, audio converters, etc.) support interleaved formats but v2 audio units are not required to (and most don't) support interleaved data.


hth,
stephen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Playing multiple sounds (From: "Andreas Falkenhahn" <email@hidden>)
 >Re: Playing multiple sounds (From: Mark Pauley <email@hidden>)
 >Re: Playing multiple sounds (From: Mark Pauley <email@hidden>)
 >Re: Playing multiple sounds (From: "Andreas Falkenhahn" <email@hidden>)
 >Re: Playing multiple sounds (From: Mark Pauley <email@hidden>)
 >Re: Playing multiple sounds (From: "Andreas Falkenhahn" <email@hidden>)
 >Re: Playing multiple sounds (From: "Andreas Falkenhahn" <email@hidden>)
 >Re: Playing multiple sounds (From: William Stewart <email@hidden>)
 >Re: Playing multiple sounds (From: "Andreas Falkenhahn" <email@hidden>)
 >Re: Playing multiple sounds (From: William Stewart <email@hidden>)
 >Re: Playing multiple sounds (From: "Andreas Falkenhahn" <email@hidden>)

  • Prev by Date: Re: Playing multiple sounds
  • Next by Date: Re: Playing multiple sounds
  • Previous by thread: Re: Playing multiple sounds
  • Next by thread: Re: Playing multiple sounds
  • Index(es):
    • Date
    • Thread