Re: Combining AUHAL input and an AudioConverter
Re: Combining AUHAL input and an AudioConverter
- Subject: Re: Combining AUHAL input and an AudioConverter
- From: Brad Ford <email@hidden>
- Date: Tue, 10 May 2005 13:15:48 -0700
On that note, you can use the
kAudioFormatProperty_AvailableEncodeChannelLayoutTags and
kAudioFormatProperty_AvailableEncodeNumberChannels properties to find
out what number of channels a given format *can* support. For
instance, Qualcomm Purevoice can only encode to mono. The above
property call will tell you that.
-Brad Ford
QuickTime Engineering
On May 10, 2005, at 12:47 PM, William Stewart wrote:
Right - sorry, I missed that - you do have to specify the number of
channels - in the case of Qualcomm for instance, as a CBR format,
this affects the other values. Good catch!
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?
You can do resampling in the converter. So, regardless of the input
sample rate you can do this for the Qualcomm output:
CAStreamBasicDescription outputFormat;
// need to set at least these fields for
kAudioFormatProperty_FormatInfo
outputFormat.mFormatID = kAudioFormatQUALCOMM;
outputFormat.mSampleRate = 8000;
outputFormat.mChannelsPerFrame = 1;//ONLY does 1 channel
// use AudioFormat API to fill out the rest.
ioSize = sizeof(outputFormat);
err = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0, NULL, &ioSize, &outputFormat);
Bill
Just as a note, you should then see this:
AudioStreamBasicDescription: 1 ch, 8000 Hz, 'Qclp' (0x00000000)
0 bits/channel, 35 bytes/packet, 160 frames/packet, 0 bytes/frame
On 10/05/2005, at 10:42 AM, Greg Chapman wrote:
On May 10, 2005, at 10:23 AM, Heath Raftery wrote:
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 don't think kAudioFormatProperty_FormatInfo will work unless you
fill in the number of channels.
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
--
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
_______________________________________________
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