Getting AudioFormatGetProperty to fillout a AudioStreamBasicDescription
Getting AudioFormatGetProperty to fillout a AudioStreamBasicDescription
- Subject: Getting AudioFormatGetProperty to fillout a AudioStreamBasicDescription
- From: Heath Raftery <email@hidden>
- Date: Fri, 4 Jul 2008 21:03:20 +1000
Way back in May of 2005 I first asked about using
AudioFormatGetProperty to populate an AudioStreamBasicDescription
based on the kAudioFormatQUALCOMM format.
http://lists.apple.com/archives/coreaudio-api/2005/May/msg00168.html
With some help from the list I was able to get by. Recently I've
noticed the solutions implemented way back then no longer work!
In particular, the following code came out of the previous discussion:
<CODE>
AudioStreamBasicDescription asbdOut;
UInt32 theSize;
memset(&asbdOut, 0, sizeof(asbdOut));
asbdOut.mFormatID = kAudioFormatQUALCOMM;
asbdOut.mSampleRate = 8000; //
kAudioFormatProperty_AvailableEncodeSampleRates says 8000 only
asbdOut.mChannelsPerFrame = 1;
theSize = sizeof(asbdOut);
theStatus = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0,
NULL,
&theSize,
&asbdOut);
</code>
Previously, this code was enough to fill out the rest of the asbd.
Now, nothing happens (which was the original problem before adding the
mChannelsPerFrame assignment). If I explicitly set
asbdOut.mBytesPerPacket = 35 before the call, all is rosy. But I'm
only able to specify this number because I know that is what it
returned in the past!
Has something changed in the way this function works? Is QUALCOMM
going away? Is the behaviour going to change again? Will specifying 35
bytes per packet explicitly suffice?
Chasing this inconsistent API around doesn't fill me with confidence.
Regards,
Heath
--
____________________________________________________________________
| Heath Raftery <email@hidden> |
| HRSoftWorks <http://www.hrsoftworks.net> |
| |
| *He who joyfully marches to music in rank and file has already |
| earned my contempt. He has been given a large brain by mistake, |
| since for him the spinal cord would suffice.* |
| - Albert Einstein _\|/_ |
|_____________________________________________________m(. .)m________|
_______________________________________________
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