Search code examples
parsingmp3id3id3v2

ID3 Parser and Editor


I'm writing an ID3 parser and editor. It does already support ID3v1, v2.1-2.3. Are there any other widely used ID3 versions or extensions? For example, I've read about Enhanced ID3v1 tag (which goes before ID3v1) and starts with "TAG+", but I've never seen it inside MP3 files. Should I implement support for it anyway?


Solution

    • "ID3v2.1" never existed.
    • Yes, Enhanced TAG identifies by TAG+, which extends IDv1.
    • For a list of all metadata systems to be expected in MP3 files see https://stackoverflow.com/a/62366354 - top priority should have ID3v2.4 as you will encounter those most aside from ID3v2.3. Then go for informal and/or legacy ones because those can still be encountered (just because files become old doesn't mean they cease to exist).

    Keep the following things in mind when parsing files:

    • A file can have both: IDv1 and IDv2 tags.
    • A file can have multiple IDv2 tags (i.e. IDv2.3 and IDv2.4). Although it shouldn't occur it should pose no problem to your parser to also accept multiple tags of the same version.
    • ID3v2 is not limited to MP3 files (but IDv1 and all its informal extensions are).
    • Consider the following parsing order in an MP3 file:
      1. Check for ID3v1 at the end of the file.
      2. Check for ID3v1.2 in front of ID3v1.
      3. Check for Enhanced TAG in front of ID3v1.
      4. Check for multiple ID3v2 at the start of file and, as for ID3v2.4, a footer at the end of the file in front of all ID3v1-like tags.