What is all this ID3 nonsense, you ask? Well it's be easy to explain if the ID3.org website were up more often. ID3 tags are small pieces of information stored inside the MP3 file. They can contain bits of metadata about the MP3, such as album name, song name, artist, original artist, genre, composer, year of release, additional comment fields, and many more. Unfortunately, there have been many versions of the ID3 spec and it has slowly been getting more and more complicated. Oh, and the tags are typed. And may have other fields than simply "value". And tags have been renamed in newer versions of the spec for no real reason other than to confuse me. A simple key -> value frame at the end of the MP3 file would have been so much simpler, but unfortunately we can't change the world overnight.
Anyway, ID3Lib reads and writes these tags. The actual library is in C++ but there is a cut-down C interface which I picked as I know no C. After refreshing my XS and typemap knowledge, it all pretty much fell into place. One strange thing was having to use g++ to compile the XS. Is there a more-portable way to find a C++ compiler than:
# In Makefile.PL
'CC' => 'g++',
'LD' => 'g++',
The current docs and API are a little lacking and there's a small memory leak, but it works! It's up on the CPAN, phew.
And thanks to Pudge for letting me use his test MP3s...