What's this "Album artist" tag iTunes uses? Any way to set it using java?

CookieMonster picture CookieMonster · May 7, 2011 · Viewed 12.1k times · Source

iTunes uses an ID3 tag called "Album Artist", and for one album to be actually grouped as an album in iTunes, both the Album Name and Album Artist must be the same.

As far as I'm concerned, Album Artist isn't an official ID3 tag, and from the ID3 libraries I've seen so far, none supported "Album Artist".

Preview

Does anyone know more about this strange tag, and how to set it in java (or with any command line utility).

Answer

Cowan picture Cowan · May 11, 2011

The commenters above are correct, TPE2 ("Band/Orchestra/Accompaniment") is the ID3 tag which is usually repurposed for this. I know that at least iTunes, Windows Media Player, J River Media Center, and XBMC all use this tag, because I use it extensively in my own music collection and all of those applications have supported it seamlessly.

To edit this tag:

Graphically: you really can't go wrong with mp3tag, the only graphical editor (Windows in this case, but works fine under Wine) I've used which handles multiple files really well (leaves values alone unless you specifically change them), lets you customise which fields you have (and how they map to ID3 or FLAC tags, etc), and has other nice stuff like handling multiple image types for the APIC tag (front cover, back cover, disc image, band photo) cleanly, etc. Highly recommended.

From the command line: the id3v2 command-line tool works a treat in this case:

$ id3v2 -l foo.mp3 
[...]
id3v2 tag info for foo.mp3:
TFLT (File type): MPG/3
TIT2 (Title/songname/content description): Because Of The Blood (Single Version)
TPE1 (Lead performer(s)/Soloist(s)): Sin Fang
TPE2 (Band/orchestra/accompaniment): Sin Fang
[...]

$ id3v2 --TPE2 "Spice Girls" foo.mp3

$ id3v2 -l foo.mp3 | grep TPE2
TPE2 (Band/orchestra/accompaniment): Spice Girls

(this tool is available by default in the Ubuntu repos, sudo apt-get install id3v2)

From Java:

Use something like the javamusictag project. I haven't used this in a while but something like:

MP3File file = new MP3File(new java.io.File("foo.mp3"));
((FrameBodyTPE2) file.getID3v2Tag().getFrame("TPE2").getBody()).setText("Backstreet Boys");
file.save();

is pretty close (or at least, close enough to get you started).