Re: Converted audio file, bit rate reported with afinfo
Re: Converted audio file, bit rate reported with afinfo
- Subject: Re: Converted audio file, bit rate reported with afinfo
- From: Doug Wyatt <email@hidden>
- Date: Sun, 16 May 2010 18:48:21 -0700
On May 15, 2010, at 8:17 , Fredrik wrote:
> Hi,
>
> I've converted a file and get the wrong bit rate reported by afinfo. The input file is a 16bit 44.1 wav file, the output file is a 12 bit 26040hz caf file defined like this:
>
> AudioStreamBasicDescription outputFormat;
>
> outputFormat.mSampleRate = 26040;
> outputFormat.mFormatID = kAudioFormatLinearPCM;
> outputFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsAlignedHigh;
> outputFormat.mBytesPerPacket = 2;
> outputFormat.mFramesPerPacket = 1;
> outputFormat.mBytesPerFrame = 2;
> outputFormat.mChannelsPerFrame = 1;
> outputFormat.mBitsPerChannel = 12;
>
> UInt32 outputBitRate = (outputFormat.mSampleRate * outputFormat.mBitsPerChannel); // 312480
>
>
> When using this bit rate in AudioConverterSetProperty with kAudioConverterEncodeBitRate, I get a 'prop' error. Setting the bit rate to 0 gives me this in afinfo, indicating that the output file is 16 bits.
With AudioConverter, the bit rate property only applies to certain codecs, never PCM.
12 bits, unpacked, aligned high is essentially the same as 16-bit with the lower 4 bits clear.
Aligned low would mean that the high 4 bits would be unused, but that's not supported by AudioConverter.
12 bits packed would be 2 samples in every 3 bytes (24 bits), and maybe that's what you're trying to accomplish, but AudioConverter does not support such formats.
Doug
_______________________________________________
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