Re: AudioFile data format falsely indicating VBR on CBR files
Re: AudioFile data format falsely indicating VBR on CBR files
- Subject: Re: AudioFile data format falsely indicating VBR on CBR files
- From: Eric Allamanche <email@hidden>
- Date: Thu, 14 Feb 2008 11:14:14 -0800
the issue is that MP3 CBR doesn't necessarily have a constant bytes
per packet count. What happens is that depending on the sample rate,
bit rate and the frame size the number of bytes per packets is a
fractional number. To cope with this, the encoder has to make every
Nth packet one byte longer in order to reach the specified bit rate.
Therefore, the mBytesPerPacket value isn't constant but varies
between N and N+1.
On Feb 14, 2008, at 10:38 AM, Jens Alfke wrote:
When I open an AudioFile on a constant-bit-rate MP3 file, and
access the kAudioFilePropertyDataFormat property, the struct
returned always shows mBytesPerPacket==0. Apparently that value
indicates that the file is VBR. But I get this on every MP3 file
I've tried, even ones I know for certain are CBR.
The code I'm using is based on the aqplay.cpp sample, where after
getting the data format it does:
bool isFormatVBR = (_info->mDataFormat.mBytesPerPacket
== 0 || _info->mDataFormat.mFramesPerPacket == 0);
So is aqplay.cpp incorrect in how it tests for VBR, or is AudioFile
returning incorrect data?
—Jens _______________________________________________
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
_______________________________________________
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