• 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 10:43:34 -0800

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)

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

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)

I'm sure there's more information on wikipedia about AAC, VBR and the like

Bill

On Mar 5, 2009, at 11:07 PM, Kyle Sluder wrote:

Hi all,

Sorry for the newbie question, but I'm just getting started with
AudioQueue.  I'm trying to figure out just what is implied by
mBytesPerPacket == 0, and separately mFramesPerPacket == 0.  The
documentation and header file comments aren't an introduction to audio
file formats, so they tend not to provide enough information for me to
grasp all of what's going on.

I need to be able to create buffers for the AudioQueue that total a
certain duration.  Most apps, like Pro Tools, have the user specify
the buffer duration in bytes, but for my app time makes more sense.
For CBR formats this is easy, but for situations where mBytesPerPacket
== 0 or mFramesPerPacket == 0 I'm a bit more confused, which is why
I'm asking.

If anyone can point me towards an explanation of the implications of
variable frames-per-packet or bytes-per-packet, I'd appreciate it.

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

_______________________________________________ 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>)

  • Prev by Date: Re: Recording compressed audio file
  • Next by Date: Re: Pitch-Shift on the iPhone
  • Previous by thread: Bytes Per Packet, Frames Per Packet?
  • Next by thread: Re: Bytes Per Packet, Frames Per Packet?
  • Index(es):
    • Date
    • Thread