Re: Validity of ACC Convertor Bitrate Values from kAudioConverterAvailableEncodeBitRates
Re: Validity of ACC Convertor Bitrate Values from kAudioConverterAvailableEncodeBitRates
- Subject: Re: Validity of ACC Convertor Bitrate Values from kAudioConverterAvailableEncodeBitRates
- From: William Stewart <email@hidden>
- Date: Wed, 27 Feb 2008 18:30:55 -0800
Tommy
Don't know, but its always helpful to have a bug to track this (so,
would you mind filing one: http://bugreporter.apple.com)
Thanks
Bill
Go Blues :P
On Feb 27, 2008, at 3:05 AM, Tommy Braas wrote:
Hi Bill mate,
I was wondering if the future tech note has been written and
published yet? If not, will it contain information on VBR and voice
specific settings for the AAC encoder as well?
Looking very much forward to reading it.
Kind regards,
\tommy
Go Essendon... ;-)
On Dec 7, 2007, at 6:58 AM, William Stewart wrote:
AAC is a tricky beast to configure.
First, you can see in the UI for the QT Player exporter the
different combinations of sample rates and bit rates. As you change
one, this restricts the valid range for the other.
The best way to set the state of the encoder is to get the
parameter dictionary back from the converter:
@constant kAudioConverterPropertySettings
Returns the a CFArray of property settings for converters.
For a converter doing AAC encoding it shows you both the full list
of available bit rates, and an applicable list (bit rates that can
be selected at this time). Probably the best UI is to only show the
applicable bit rates (rather than a whole range of un-selectable
ones). Same applies for sample rates.
For each bit rate, there is a recommended sample rate. For each
sample rate, there is a recommended bit rate.
So, in the dictionary, by setting one of these to 0 that signals
that you want the recommended one (this also applies to the two
properties that track this):
From the header doc for <AudioToolbox/AudioConverter.h>
@constant kAudioConverterEncodeBitRate
A UInt32 containing the number of bits per second to aim for
when encoding
data. Some decoders will also allow you to get this property
to discover the bit rate.
@constant kAudioConverterEncodeAdjustableSampleRate
For encoders where the AudioConverter was created with an
output sample rate
of zero, and the codec can do rate conversion on its input,
this provides a
way to set the output sample rate. The property value is a
Float64.
It is a little tricky, so we should probably have a tech note to go
through some of the details of this.
Bill
On Dec 6, 2007, at 10:35 AM, Jaime Magiera wrote:
Hello,
Perhaps this is a misunderstanding on my part. I'll break my
questions down as specific as possible...
1. Is the proper way to determine the possible bitrate values of
an encoder to query the file convertor's
kAudioConverterAvailableEncodeBitRates value?
2. If the answer is yes, then, theoretically, should I be able to
successfully record an AAC file at any of the bitrates returned in
that array? (accounting for stereo/mono of course)
3. If the answer is yes, then how do the following numbers work
out ?...
- I create an sbd with a sampling rate of 44100, create a file
based on that...
dataFormat.mSampleRate = [[[self documentPreferences]
objectForKey:@"audioSamplingRate"] intValue];
dataFormat.mFormatID = kAudioFormatMPEG4AAC;
dataFormat.mFormatFlags = 0;
dataFormat.mChannelsPerFrame = [[[self documentPreferences]
objectForKey:@"audioChannelCount"] intValue];
dataFormat.mFramesPerPacket = 1024;
dataFormat.mBitsPerChannel = 0;
dataFormat.mBytesPerPacket = dataFormat.mBytesPerFrame = 0;
- Then get the converter for that file and query it for supported
rates...
CAAudioFile &recfile = [self audioFileRecorder]->GetFile();
AudioConverterRef converter = recfile.GetConverter();
AudioConverterGetPropertyInfo( converter,
kAudioConverterAvailableEncodeBitRates,
&outSize,
&outWritable);
AudioValueRange *valueRange = (AudioValueRange *)malloc(outSize);
AudioConverterGetProperty( converter,
kAudioConverterAvailableEncodeBitRates,
&outSize,
valueRange);
- The results...
2007-11-29 15:39:56.956 MyApp[3830:813] Minimum 8000.000000,
Maximum 8000.000000
2007-11-29 15:39:56.957 MyApp[3830:813] Minimum 12000.000000,
Maximum 12000.000000
2007-11-29 15:39:56.958 MyApp[3830:813] Minimum 16000.000000,
Maximum 16000.000000
2007-11-29 15:39:56.959 MyApp[3830:813] Minimum 20000.000000,
Maximum 20000.000000
2007-11-29 15:39:56.959 MyApp[3830:813] Minimum 24000.000000,
Maximum 24000.000000
2007-11-29 15:39:56.960 MyApp[3830:813] Minimum 28000.000000,
Maximum 28000.000000
However, a kindly person from Apple posted these as the supported
rates...
44100, 48000 Hz: 32000 to 160000 bps
Any thoughts greatly appreciated. Instead of hardcoding the
bitrates, I wanted to let my users select based on any of those
available.
thanks,
Jaime
_______________________________________________
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
_______________________________________________
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