Did you ever take a look at the information from CDDB servers before you rip your CD collection to your hard drive? People are fucking insane. Well, they are not. But they do have different tastes. And what you end up with in your audio files, is an inconsistent mess. And consistency is good. Inconsistency is not.

In order to make things more consistent again, you have to change the meta data contained within your audio files. You know, ID3 tags and all that. Different file types obviously use different kinds of meta data. And some file types may use more than one, because some designers are high on crack (“Hello id3v1 development team!”): For example, in mp3 files, you're likely to find id3v1 tags, id3v2 tags (of differering sub-versions) and apetag tags (as far as I know, this is basically because the guys writing the foobar2000 audio player for windows were fed up with the id3* mess, and thought adding one slightly less confusing system would be the least painful solution).

There are command line utilities for all those formats. And they all work differently. That's to be expected, but it's inconvenient to write higher level tools with them to handle many file types transparently.

You know the obvious reaction of anyone who is a little too full of himself: “Man... How hard can it be?“ - That feeling takes as long as it takes you to weed through the first few pages of implementation details for the first tag implementation for the first format you want to support.

It's certainly not easy. Luckily, there are people who are crazy enough to write libraries for this sort of thing. The library that stuck out the most in this field (at least to my untrained eye) is TagLib. It support a large list of audio file types along with all tag implementations you would ever care about.

It's a C++ library, and since I'm not much of a C++ programmer, I was happy to see that TagLib has bindings for C programmers, too. So I wrote a little program called ‘taggit’, that uses those bindings. Unfortunately, the library's C bindings are vastly incomplete. They only cover the most basic tag information like “artist”, “album” and such. To support more, I starting writing a bit of glue code to interface the C++ part of the library from C. And boy, is that an experience I don't want to relive ever again.

The real solution would be to rewrite the program using C++ to properly leverage TagLib's native API. But then there's me and C++. We never got quite along. This was in 2009, so the new and shiny C++11 standard wasn't quite done yet. Still, I started the effort, but soon got bored with it. And so, ‘taggit’ bit-rotted for the better part of four years.

Then recently, my brother hinted me at a bunch of talks, that show-cased some of the things that got way nicer in C++11 and I was motivated to give my little project another go. And it got along fairly quickly.

Then I found out, that the name ‘taggit’ was already taken by another project. So I had to come up with another name (that process - by the way - is the stuff that large posts in the ‘rant’ category are made of; so I'll skip that). The name I settled for is ‘amded’, which is short for: Audio-Meta-Data-EDitor

At the moment it supports mp3 files, ogg-vorbis files and ogg-flac files. In mp3 files, all three major tag implementations are supported (id3v1, id3v2 and apetag). All thanks to TagLib. Adding other file types, supported by TagLib should not be too much of a problem, since all the infrastructure is already there. The same goes for tags, as long as TagLib puts them into their PropertyMap abstraction.

‘amded’ is not really meant to be used directly by a user. It's more of a backend tool for higher-level utilities to use. For that, it features things like machine-readable output when listing the values of tags in a file.

If you just want something to edit tag, take a look at ‘easytag’ instead (although that one doesn't support apetags in mp3 files).

It's also not too broadly tested. I still need to move my front-end code from using separate tools (‘id3v2’, ‘vorbiscomment’ and ‘metaflac’) to ‘amded’.

Long story short:

Needs a fairly recent version of TagLib and a C++11 compiler for building the executable and txt2tags for building the manual page.

Posted Wed 06 Nov 2013 15:34:46 CET Tags: