TagLib
Version 1.0
Introduction
TagLib, is well, a library for reading and editing audio meta data, commonly know as tags.Some goals of TagLib:
- A clean, high level, C++ API to handling audio meta data.
- Support for at least ID3v1, ID3v2 and Ogg Vorbis comments.
- A generic, simple API for the most common tagging related functions.
- Binary compatibility between minor releases using the standard KDE/Qt techniques for C++ binary compatibility.
- Make the tagging framework extensible by library users; i.e. it will be possible for libarary users to implement additional ID3v2 frames, without modifying the TagLib source (through the use of Abstract Factories and such.
Because TagLib desires to be toolkit agnostic, in hope of being widely adopted and the most flexible in licensing TagLib provides many of its own toolkit classes; in fact the only external dependancy that TagLib has, it a semi-sane STL implementation.
Why TagLib?
TagLib was written to fill a gap in the Open Source/Free Software community. Currently there is a lack in the OSS/FS for a homogenous API to the most common music types. In fact the only semi-portable implementation of the ID3v2 standard available on Linux is id3lib, which unfortunately is poorly written, poorly documented and which cycles through maintainers at least once a year (I took my turn some time ago.).As TagLib will be initially injected into the KDE community, while I am not linking to any of the KDE or Qt libraries I have tried to follow the coding style of those libraries. Again, this is in sharp contrast to id3lib, which basically provides a hybrid C/C++ API and uses a dubious object model.
I get asked rather frequently why I am replacing id3lib (mostly by people that have never worked with id3lib), if you are concerned about this please email me; I can provide my lengthy standard rant. :-)
Examples:
I've talked a lot about the homogenous API to common music formats. Here's an example of how things (will) work:
TagLib::FileRef f("Latex Solar Beef.mp3"); TagLib::String artist = f.tag()->artist(); // artist == "Frank Zappa" f.tag()->setAlbum("Fillmore East"); f.save(); TagLib::FileRef g("Free City Rhymes.ogg"); TagLib::String album = g.tag()->album(); // album == "NYC Ghosts & Flowers" g.tag()->setTrack(1); g.save();
Notice that these high level functions work for both Ogg and MP3. For this high level API, which is suitable for most applications, the differences between ID3v2, ID3v1, MPEG and Ogg Vorbis can all be ignored.
- Author:
- Scott Wheeler <wheeler@kde.org>