Re: Combining AUHAL input and an AudioConverter
Re: Combining AUHAL input and an AudioConverter
- Subject: Re: Combining AUHAL input and an AudioConverter
- From: Heath Raftery <email@hidden>
- Date: Wed, 11 May 2005 03:23:59 +1000
On 10/05/2005, at 8:54 AM, William Stewart wrote:
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.
Ah, perhaps I was confusing bit rate with sample rate. Nonetheless, I'm
not actually doing any sampling (that the input unit's job) so I'm
hoping the converter is able to lower the sample rate (I don't want to
send 48kHz audio over the network!). Should I instead match the output
format sample rate to the sample rate of the audio coming in and do
downsampling elsewhere?
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)
Ah yes, I was experimenting with this earlier. I'll give your approach
another go....
<CODE - filename changed from main.c to main.cpp>
#include <CoreServices/CoreServices.h>
#include <CoreAudio/CoreAudio.h>
#include "CAStreamBasicDescription.h"
#include <AudioUnit/AudioUnit.h>
#include <AudioToolbox/AudioToolbox.h>
int main (int argc, const char * argv[])
{
OSStatus theStatus;
CAStreamBasicDescription desc;
UInt32 theSize;
memset(&desc, 0, sizeof(desc));
desc.mFormatID = kAudioFormatQUALCOMM;
desc.mSampleRate = 48000;
theSize = sizeof(desc);
theStatus = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0, NULL, &theSize, &desc);
desc.Print();
return 0;
}
</CODE>
What this does is fills out the rest of the ASBD based on the format.
Alas, it still does not :(
<CONSOLE>
AudioStreamBasicDescription: 0 ch, 48000 Hz, 'Qclp' (0x00000000) 0
bits/channel, 0 bytes/packet, 0 frames/packet, 0 bytes/frame
</CONSOLE>
I even tried iterating over integer sample rates from 0 to 50000 with
no change. I was able to get the frames/packet field alone to show a
little life when using some of the other formats, but nothing with
QualCOMM.
Am I really seeing unexpected behaviour? I've reproduced the same
results on a G4 iMac OS 10.3.8 with iSight and on a G4 Powerbook OS
10.4 (8A425). Can anyone else reproduce the behaviour or demonstrate an
alternate outcome?
CAStreamBasicDescription is in PublicUtility - you should use this
class
Found it, cheers.
Bill
Thanks Bill. As you can imagine, this has been a very frustrating
development experience for the last 5 months, and puts a real dampner
on the development schedule. I'd really appreciate any further
suggestions, or even some pointers on who to harrass at WWDC!
Heath
_______________________________________________
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