Tuesday, October 6, 2009

Audio file tags- and problems therewith

Audio files like MP3 files can contain metadata (information about the information) in a "tag" (an appendage to the file.). That's why when a music player plays a music file, it can show the album, artist and track information even if the folder and file names do not carry this information. Of course, if there is no metadata, a music player will not show album, artist and track information, even if the folder and files do carry this information.
Ripping a CD to MP3 will result in files that play as "Track 1, Unknown Album, Unknown Artist" or similar- unless the ripping program is capable of looking up these details and appending them to the MP3 file. (See a later post.)
A problem can arise if music tracks are incorrectly tagged, because music players use the tags (not folder and file names) to organise a library. So a stray space or upper case letter in the wrong place in a track or artist title can mean an album appears twice in a music library.
Some music players are better at dealing with minor errors like this and will group tracks and albums correctly even if there are minor differences in tags. Winamp in Windows is pretty good in this respect; music players in Gnome seem to be more fussy. (Amarok is as good or better than Winamp, but it's a KDE application- usable in Gnome, but slow to load and a different theme.)
A error in the way a music player organises tracks and albums in a music library means looking at the file tags for errors. Here's where the fun starts. There are two different standards for tagging MP3 files, and several different versions of the second standard. (Wikipedia has a good write-up.) How to view and edit tag information?
My music collection is on a Windows partition, and I've always used Winamp for tag editing, but recently I had a problem with an MP3 file tag causing problems, so I thought I'd try some Gnome alternatives. Amarok has excellent tag editing, but, as I've mentioned before, it's a KDE application- usable, but not ideal in Gnome.)
I tried Rhythmbox and Banshee (two music players with tag editors) but couldn't see the problem. I also tried a couple of tag editors- Audio Tag Tool and EasyTAG. I booted into Windows and looked at the album with Winamp: the problem was obvious in Winamp's excellent tag editor: a superfluous "Album Artist" compilation ID3V2 tag was causing a music player to mis-identify an album as a compilation. ("The Pot" in this screenshot.)

The tag didn't show up in EasyTAG:

Going back to Audio Tag Tool and clicking the "Advanced" button, I was able to see the offending tag, this time in a field called "Band".

Deleting the "Album Artist" tag in Winamp allowed the music player to list the album correctly, but curiously left Audio Tag Tool unable to view any of the ID3V2 tags.

This illustrates another problem: there are different versions of the ID3V2 standard, and tags written in one version may not be readable in another.
I later came across Kid3, a KDE tag editor, which listed the "Album Artist" tag correctly: in fact, as clearly as Winamp.

The problem with Kid3 on Gnome is it requires a lot of KDE dependencies, and uses the KDE theme. Not show-stoppers, but a good Gnome application would have been nice.
UPDATE: A comment to a subsequent post points out that kid3-qt is available in Gnome without the KDE dependencies.
Verdict: If you want to edit tags in Linux, KDE has the best applications: Amarok and Kid3.
In Gnome, there is nothing which will view and edit all standards and versions of MP3 tag accurately and without errors. Or if there is, I haven't found it.
UPDATE: Maybe I have! It's called Mutagen: it's used by several Gnome programs to edit MP3. Here's a couple of examples of programs which use it, and how they found the error described in the post.
The first is the Edit>Details screen of MusicBrainz Picard.

Next we have Ex Falso.

Exaile, which also uses the Mutagen backend, also displayed the "Album Artist" tag correctly.
I'm not sure why Ex Falso labelled the tag as "Performer" rather than "Album Artist", but I think it's an issue with the ID3V2 standard.
Mutagen can read all versions of the ID3V2 standard.
UPDATE 2: Mutagen doesn't appear to recognise ID3V1 tags: trying out Quod Libet and Exaile, I found that tracks tagged only in ID3V1 are listed as "unrecognised".
UPDATE 3: Even if the above players can't recognise tracks on the basis of ID3v1 information, Mutagen based tag editors have no problem doing so see this test.

1 comment: