TagLib is a library for reading and editing audio metadata, commonly known as tags.
Features:
TagLib originally was written to provide an updated and improved ID3v2 implementation in C++ for use in a variety of Open Source projects. Since development began in 2002 and the 1.0 release in 2004 it has expanded to cover a wide variety of tag and file formats and is used in a wide variety of Open Source and proprietary applications. It now supports a variety of UNIXes, including Apple's macOS, as well as Microsoft Windows.
TagLib's licenses do allow usage within proprietary (closed) applications, however TagLib is not public domain. Please note the requirements of the LGPL or MPL, and adhere to at least one of them. In simple terms, you must at a minimum note your usage of TagLib, note the licensing terms of TagLib and if you make changes to TagLib publish them. Please review the licenses above before using TagLib in your software. Note that you may choose either the MPL or the LGPL, you do not have to fulfill the requirements of both.
Please see the TagLib website for the latest downloads.
TagLib can be built using the CMake build system. TagLib installs a CMake configuration and a taglib-config and pkg-config file to make it easier to integrate into various build systems. Note that TagLib's include install directory must be included in the header include path. Simply adding <taglib/tag.h> will not work.
Detailed instructions about building TagLib itself and building with TagLib can be found in INSTALL.md
TagLib provides both simple, abstract APIs which make it possible to ignore the differences between tagging formats and format specific APIs which allow programmers to work with the features of specific tagging schemes. There is a similar abstraction mechanism for AudioProperties .
The best place to start is with the Class Hierarchy linked at the top of the page. The File and AudioProperties classes and their subclasses are the core of TagLib. The FileRef class is also a convenient way for using a value-based handle.
Here's a very simple example with TagLib:
If the basic tag interface, which provides methods like title() , artist() , album() , comment() , genre() , year() , track() and the corresponding setters, is not enough, the PropertyMap interface offers a flexible abstraction for textual metadata. See Mapping of Properties to Various Formats for details about the mapping of tags to properties.
An additional abstraction is provided to handle complex (i.e. non textual) properties.
Finally, for full control, there are specific types for all supported metadata formats.
More examples can be found in the examples directory of the source distribution.
Questions about TagLib should be directed to the TagLib mailing list, not directly to the author.