[ID3 Dev] Finding the end of an ID3 Header

Jim jmartin92 at comcast.net
Mon Nov 6 14:14:35 PST 2006

Your calculation of the indicated size of the ID3v2 tag seems correct to me.  However, it's pretty hard to guess at what might be going on without having more of the file (or at least the beginning of the "real" mp3 file) to examine.  It could be a tag header doesn't give the correct size of the tag.  Or there could be a problem with the mp3 file.

I would guess that most mp3 players (at least the good ones) do use some kind of search for the frame sync.

Jim Martin
  ----- Original Message ----- 
  From: Robert Sewell 
  To: id3v2 at id3.org 
  Sent: Monday, November 06, 2006 4:58 PM
  Subject: [ID3 Dev] Finding the end of an ID3 Header



  I have a need to verify that mp3 files uploaded by our users comply with certain minimum specs (bit and sample rates, etc.).  To get to the mp3 headers, I first have to check for an ID3 tag, and if found, use bytes 6-9 to calculate the location of the first mp3 frame.  My routine seems to work in most cases.  However, I've got one mp3 files that doesn't seem to fit the specs, and fails my verification process, although all mp3 players play the file without a problem.  Below are the first 13 bytes of the file:


  49 44 33 03 00 00 00 01 79 76 57 4F 41 46


  If I am interpreting the ID3 specs correctly, the first mp3 frame should be found at offset 7D00.  However, I only find 00 there; the first mp3 is really at 7EA1.


  Am I missing something?  Or did the program that added the ID3 tag miscalculate the ID3v2 size bytes?  If the latter, do all players allow for mistakes and just start hunting for the 11-bit frame sync?


  Thanks in advance,


  Robert Sewell



If you do not wish to receive future commercial e-mail messages from SESAC, you may send an e-mail message from this address to optout at sesac.com

CONFIDENTIALITY NOTICE:  This e-mail transmission, and any documents, files, or other e-mail messages attached to it, may contain confidential information that is legally privileged.  If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED.  If you have received this transmission in error, please immediately notify the sender via e-mail or by telephone at 615.320.0055 and destroy the original transmission and its attachments without reading them or saving them to disk.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.id3.org/pipermail/id3v2/attachments/20061106/5d12e344/attachment.html>

More information about the ID3v2 mailing list