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

Set kAudioUnitProperty_StreamFormat seems to be broken


  • Subject: Set kAudioUnitProperty_StreamFormat seems to be broken
  • From: Brian Barnes <email@hidden>
  • Date: Fri, 28 Sep 2001 01:19:36 -0400

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.

[>] Brian


  • Follow-Ups:
    • Re: Set kAudioUnitProperty_StreamFormat seems to be broken
      • From: Bill Stewart <email@hidden>
  • Prev by Date: Re: USBDeviceOpen eventually returns kIOReturnExclusiveAccess
  • Next by Date: Component List application
  • Previous by thread: Re: USBDeviceOpen eventually returns kIOReturnExclusiveAccess
  • Next by thread: Re: Set kAudioUnitProperty_StreamFormat seems to be broken
  • Index(es):
    • Date
    • Thread