Validity of ACC Convertor Bitrate Values from kAudioConverterAvailableEncodeBitRates
Validity of ACC Convertor Bitrate Values from kAudioConverterAvailableEncodeBitRates
- Subject: Validity of ACC Convertor Bitrate Values from kAudioConverterAvailableEncodeBitRates
- From: Jaime Magiera <email@hidden>
- Date: Thu, 6 Dec 2007 13:35:28 -0500
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