• 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
MP3 Frames vs Packets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MP3 Frames vs Packets


  • Subject: MP3 Frames vs Packets
  • From: Dominic Feira <email@hidden>
  • Date: Mon, 7 Nov 2005 16:35:52 -0500

Hello.

Can anybody explain to me the relation between mp3 frames and packets?  The ASBD description that I have found for mp3 is this:

desc.mSampleRate = 44100.00;
desc.mFormatID = kAudioFormatMPEGLayer3;
desc.mFramesPerPacket = 1152;
desc.mChannelsPerFrame = 2;

Assume all other fields are set to zero.

Now, if I have mp3 data that is 44100.00Hz and 128kbps, I have found online that a frame length can be calculated as:  

frameLength = ((144 * (bitRate * 1000)) / sampleRate) + padding

For 128kbps and 44100.00hz this equals 417 or 418 bytes depending on wether or not padding is required.  So, it seems that an audio converter that needs 1 packet of mp3 audio data needs approximately: 1 packet * (1152 frames / packet) * (417 bytes / frame) = 480384 bytes (469k).

Is this correct?  It sure seems like an awful lot of data to read in one pass.  What if there is only 32k available?  How can I return less than 1 packet of data that isn't at the end of the stream?

Dominic Feira / Code Monkey / Ambrosia Software, Inc
 _______________________________________________
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: MP3 Frames vs Packets
      • From: Doug Wyatt <email@hidden>
  • Prev by Date: Re: Updating a View component about indexed parameter states
  • Next by Date: Re: Updating a View component about indexed parameter states
  • Previous by thread: Re: AuVal Error
  • Next by thread: Re: MP3 Frames vs Packets
  • Index(es):
    • Date
    • Thread