• 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: Bytes Per Packet, Frames Per Packet?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bytes Per Packet, Frames Per Packet?


  • Subject: Re: Bytes Per Packet, Frames Per Packet?
  • From: William Stewart <email@hidden>
  • Date: Fri, 6 Mar 2009 13:54:40 -0800


On Mar 6, 2009, at 12:48 PM, Kyle Sluder wrote:

On Fri, Mar 6, 2009 at 1:43 PM, William Stewart <email@hidden> wrote:
If mBytesPerPacket is zero it means that every discreet packet of audio data
(think of an AAC or MP3 encoded frame) can be a different size in bytes -
this is the normal definition of VBR compressed audio (the same number of
sample frames per packet, but a variable number of bytes per packet)

Okay, I'm with you so far.

If mFramesPerPacket is zero, then it means that each audio packet can
represent a variable duration - that is, a given audio packet can represent
a different number of sample frames. The Vorbis format uses this

So this is another definition of VBR

yes - AAC does the same technique that Vorbis does, but it hides this variability of time in a constant time per packet format


, or another way of organizing
compressed audio data entirely?  Does mFramesPerPacket == 0 imply
mBytesPerPacket != 0?

Nope - there's no necessary relations between the two



When you are dealing with variable data size or samples, then you have to
represent these values with external information - that is what the packet
descriptions are provided for. In the packet descriptions a value of zero
means that that field is ignored (so, an AAC packet description will specify
N for the numBytesPerPacket, and 0 for the numFrames, because AAC provides a
constant frames per packet value)

Keeping with your AAC example: the audio stream description (a property of the audio file) will have a non-zero mFramesPerPacket and a zero mBytesPerPacket for an AAC file, but each packet description will have the opposite?

yes, because the packet description has to describe the size of each packet (so that's the non-zero field), but the frames per packet are zero because AAC has a constant frames/packet


This is true of many (most) other compressed formats - FLAC, apple lossless, amr, mp3, aac variants., ac-3, etc

Bill



Thanks,
--Kyle Sluder

_______________________________________________ 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
  • Follow-Ups:
    • Re: Bytes Per Packet, Frames Per Packet?
      • From: Kyle Sluder <email@hidden>
References: 
 >Bytes Per Packet, Frames Per Packet? (From: Kyle Sluder <email@hidden>)
 >Re: Bytes Per Packet, Frames Per Packet? (From: William Stewart <email@hidden>)
 >Re: Bytes Per Packet, Frames Per Packet? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Send midi to host application
  • Next by Date: Re: Recording compressed audio file
  • Previous by thread: Re: Bytes Per Packet, Frames Per Packet?
  • Next by thread: Re: Bytes Per Packet, Frames Per Packet?
  • Index(es):
    • Date
    • Thread