• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AudioFile data format falsely indicating VBR on CBR files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >AudioFile data format falsely indicating VBR on CBR files (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Streaming to AudioQueue without having random access to data?
  • Next by Date: Re: Streaming to AudioQueue without having random access to data?
  • Previous by thread: AudioFile data format falsely indicating VBR on CBR files
  • Next by thread: Streaming to AudioQueue without having random access to data?
  • Index(es):
    • Date
    • Thread