How iTunes Uses ID3 Tags
A little terminology before you read:
- ID3 - the most commonly used way to add meta information to MP3 files (i.e. song title, artist name, album artwork, etc.)
- frame - a specific "box" of information in ID3
Also note that the version of iTunes I am currently running is 10.1.0.56 on Windows. This information might change slightly as iTunes matures, a.k.a. it's size and speed becomes more and more akin to a humpback whale.
I've always wondered how iTunes writes song information to the file... so I took a MP3 file with no tag information (I created it in Audacity. It was a recording of me sneezing) and opened it up in iTunes and added every possible field. Then I ran the MP3 file through a little program which is part of the TagLib source code (it's the test program called framelist). I've learned a few interesting things.
First, iTunes writes tags to MP3 files using ID3v2.2 tags. After a bit of research, it looks like ID3v2.2 tags are considered deprecated. See this link on id3.org for more information.
Second, iTunes completely blows the ID3v2.2 standard out of the water. By that I mean it doesn't follow the rules AT ALL. For example, it uses the TPE1 to hold the Artist information. ID3v2.2 doesn't even have that frame! This frame was introduced in ID3v2.3!
Third, they use some made up tags that aren't outlined in any official ID3 document, such as the TCP frame (used to say whether the file is in a compilation album).
Here are all the discoveries I have made concerning which ID3v2 tags go with which form field in iTunes' tag editor.
|iTunes Tag Section||iTunes Tag Field||ID3v2 Tag Field||Notes||ID3 Compliance|
|Info / Sorting||Name||TIT2||ID3v2.3 ID3v2.4|
|Info / Sorting||Artist||TPE1||ID3v2.3 ID3v2.4|
|Info / Sorting||Album Artist||TPE2||ID3v2.3 ID3v2.4|
|Info / Sorting||Album||TALB||ID3v2.3 ID3v2.4|
|Info / Sorting||Grouping||TIT1||ID3v2.3 ID3v2.4|
|Info / Sorting||Composer||TCOM||ID3v2.3 ID3v2.4|
|Info||Track Number||TRCK||2||ID3v2.3 ID3v2.4|
|Info||Disc Number||TPOS||3||ID3v2.3 ID3v2.4|
|Info||Part of a compilation||TCP or TCMP||4||none|
|Sorting||Sort Name||TST or TSOT||none|
|Sorting||Sort Artist||TSA or TSOA||none|
|Sorting||Sort Album Artist||TSP or TSOP||none|
|Sorting||Sort Album||TS2 or TSO2||none|
|Sorting||Sort Composer||TSC or TSOC||none|
|Options||Part of a gapless album||COMM||5||ID3v2.3 ID3v2.4|
- In the official ID3 documents, this field is described as a timestamp, but in MP3 you find floating around, you'll rarely find anything more specific than the year of publication.
- This can include just the track number, or the track number with the total number of track on the album. If both are present they are separated by "/".
- See the previous note.
- It seems this tag is completely made up by iTunes.
- Comment description: "iTunSMPB". This value is either a 0 or 1, determining whether or not the track is part of a gapless album.
- Multiple APIC entries are made as you more artwork is added. They are all set to type 0 (other).
- Comment description: "iTunNORM". I believe this is automatically generated by iTunes to normalize track volume.
- Comment description: "iTunSMPB". I don't know what this field means.
- Comment description: "iTunes_CDDB_IDs". I am also not sure what this field is for. See this link for some details.
- When you rip a CD directly to MP3 in iTunes, the TENC field is filled with the version of iTunes that encoded the MP3, i.e. "iTunes 10.1.0.56"
- Also when you rip a CD directly to MP3 in iTunes, the UFID has the URL "http://www.cddb.com/id3/taginfo1.html" set as the owner and a alphanumeric hash as the identifier (most likely the Gracenote ID).
The following fields that you can apply to a track in iTunes are not stored in the file and are not maintained if you move the MP3 file in question to another iTunes library: Show, Season Number, Episode ID, Episode Number, Sort Show, Volume Adjustment, Equilizer Preset, Media Kind, Rating, Start Time, Stop Time, Remember playback position, and Skip when shuffling.