• 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: Set kAudioUnitProperty_StreamFormat seems to be broken
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set kAudioUnitProperty_StreamFormat seems to be broken


  • Subject: Re: Set kAudioUnitProperty_StreamFormat seems to be broken
  • From: Bill Stewart <email@hidden>
  • Date: Sat, 29 Sep 2001 15:17:59 -0700

On Thursday, September 27, 2001, at 10:19 PM, Brian Barnes wrote:

Alright. I've got it to play AIFFs. I'll post my code as soon as somebody tells me what this problem is (and answers any of my other outstanding questions!)

I queried the AU "kAudioUnitProperty_StreamFormat" and got this:

austream.mSampleRate=44100;
austream.mFormatID=kAudioFormatLinearPCM;
austream.mFormatFlags=kLinearPCMFormatFlagIsFloat|kLinearPCMFormatFlagIsBigEndian|
kLinearPCMFormatFlagIsPacked;
austream.mBytesPerPacket=8;
austream.mFramesPerPacket=1;
austream.mBytesPerFrame=8;
austream.mChannelsPerFrame=2;
austream.mBitsPerChannel=32;

So, I make an AIFF just like that, 44.1, 16-bit, stereo. Works like a charm!

Then, I redo the AIFF to make it mono, and run this code:

austream.mSampleRate=44100;
austream.mFormatID=kAudioFormatLinearPCM;
austream.mFormatFlags=kLinearPCMFormatFlagIsFloat|kLinearPCMFormatFlagIsBigEndian|
kLinearPCMFormatFlagIsPacked;
austream.mBytesPerPacket=4;
austream.mFramesPerPacket=1;
austream.mBytesPerFrame=4;
austream.mChannelsPerFrame=1;
austream.mBitsPerChannel=32;
err=AudioUnitSetProperty(audiounit,kAudioUnitProperty_StreamFormat,kAudioUnitScope_Input,
0,(void*)&austream,sizeof(AudioStreamBasicDescription));

AudioUnitSetProperty returns WITHOUT an error, but the sound AIFF plays twice as fast (the default settings are still in effect.) I moved around the places I call this, to no effect. I can give my sample code if somebody at Apple wants to check this out.

The unit isn't dealing with mono data - we've done some work with this formatting stuff in 10.1, but there may still be lingering bugs - please check this out in 10.1 and let us know what unit is having trouble with the mono input...

Bill


[>] Brian
_______________________________________________
coreaudio-api mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/coreaudio-api


mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
Cat: "Leave me alone, I'm trying to nap... Ah, What's that clicking noise?"
__________________________________________________________________________


  • Follow-Ups:
    • Re: Set kAudioUnitProperty_StreamFormat seems to be broken
      • From: Brian Barnes <email@hidden>
References: 
 >Set kAudioUnitProperty_StreamFormat seems to be broken (From: Brian Barnes <email@hidden>)

  • Prev by Date: Re: More Audio Unit Questions
  • Next by Date: Re: Set kAudioUnitProperty_StreamFormat seems to be broken
  • Previous by thread: Set kAudioUnitProperty_StreamFormat seems to be broken
  • Next by thread: Re: Set kAudioUnitProperty_StreamFormat seems to be broken
  • Index(es):
    • Date
    • Thread