Re: Combining AUHAL input and an AudioConverter
Re: Combining AUHAL input and an AudioConverter
- Subject: Re: Combining AUHAL input and an AudioConverter
- From: William Stewart <email@hidden>
- Date: Mon, 9 May 2005 15:54:57 -0700
On 09/05/2005, at 12:02 PM, Heath Raftery wrote:
On 10/05/2005, at 3:44 AM, William Stewart wrote:
On 06/05/2005, at 9:27 PM, Heath Raftery wrote:
Sure, but Qualcomm is an audio compression format, which can
operate at a range of sample rates, right?
I don't think it does care about sample rate, but you still need to
tell it what sample rate you are going to have - all audio has a
sample rate.
I hope to vary the compression level based on my available network
bandwidth - is this where I do it? Anyway, that's battle for the
future. This is all based on guesswork though, I haven't found any
source or example code that actually uses a AudioFormat, let alone
the Qualcomm one.
What does the ASBD look like after you make the call to
AudioFormatGetProperty?
Unfortunately it looks just like it did before the call. I've
literally just written the following program:
<CODE>
#include <CoreServices/CoreServices.h>
#include <CoreAudio/CoreAudio.h>
#include <AudioUnit/AudioUnit.h>
#include <AudioToolbox/AudioToolbox.h>
int main (int argc, const char * argv[])
{
OSStatus theStatus;
AudioStreamBasicDescription asbdOut;
UInt32 theSize;
memset(&asbdOut, 0, sizeof(asbdOut));
asbdOut.mFormatID = kAudioFormatQUALCOMM;
theSize = sizeof(asbdOut);
theStatus = AudioFormatGetProperty
(kAudioFormatProperty_FormatInfo, theSize, &asbdOut, &theSize,
&asbdOut);
return 0;
}
</CODE>
Try this.
CAStreamBasicDescriptions desc.
desc.mFormatID = kAudioFormatQUALCOMM;
desc.mSampleRate = WHAT IS YOUR SAMPLE RATE :-)
theStatus = AudioFormatGetProperty (kAudioFormatProperty_FormatInfo,
0, NULL, &theSize, &desc);
the 0, NULL are because you DON'T have a magic cookie (that's what
the specifier is meant to be providing)
Then,
desc.Print();
(or have a look at the structure)
What this does is fills out the rest of the ASBD based on the format.
CAStreamBasicDescription is in PublicUtility - you should use this class
Bill
Just before the call to AudioFormatGetPropert, asbdOut has
1365470320 for mFormatID and zero everywhere else. After the call
(and a bit of a pause) theStatus is zero and asbdOut remains the
same. Bugger ay? Of course, I've tried plenty of other permutations
(including separate in and out asbd's) with no success. Slipping
kAudioFormatProperty_FormatName in there instead, works as
expected. Incidentally it doesn't seem to matter than I'm
specifying Qualcomm. None of the formats appear to fill out the asbd.
Thanks for the reply Bill.
Heath
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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