TagLib# is a .NET library capable of reading and writing both the basic and advanced tagging information stored in popular audio formats. The majority of the code and the underlying framework is a port of the TagLib tagging library from C++ to C# on .NET and Mono.
The project was inspired by the needs of Muine, a music player for Linux. Muine reads complex tag information such as artists (plural), performers, and album art. Given the state of audio tagging with Mono, the developers were limited to three options: 1) use Entagged# at the cost of many of these features, 2) use TagLib by developing both a complex C wrapper and a glue class for that wrapper, or 3) use a bunch of modified C libraries. The third was chosen as the best, but really none of the choices are really ideal. TagLib# exists so developers can have a simple "just works" solution to all their tagging needs. TagLib# is is used by the Banshee Media Player, and is now maintained by that same development team.
|
[edit] Recent NewsFollow the latest commits to the project on the ChangeLog. Read the release notes for the most recent release.
|
|
[edit] Project Resources[edit] Developer Notes
[edit] ReleasesThe most recent release of TagLib# is 2.0.3.2, released on February 16, 2009. Download [edit] Browse the SourceBrowsing the Subversion tree gives you a great view into the current status of this project's code. You may also view the complete histories of any file in the repository.
Note: TagLib# is hosted on Mono's subversion repository. [edit] Report a BugIf something isn't working, something important is missing, or you really want feature x? You can submit them to the GNOME bugzilla under the taglib-sharp component: |
Below are some simple examples for getting started. More complex examples, including file type resolvers and file abstractions are available here: TagLib Sharp: Examples
The most basic features of any tagging system are easy to access with TagLib#, as all you have to do is:
try
{
TagLib.File file = TagLib.File.Create ("/path/to/music/file.mp3");
System.Console.WriteLine ("Title: " + file.Tag.Title);
System.Console.WriteLine ("Album: " + file.Tag.Album);
// Some entries support multiple strings.
foreach (string artist in file.Tag.AlbumArtists)
System.Console.WriteLine ("Artist: " + artist);
}
catch {...}
More advanced features can be accessed by using TagLib.File.GetTag (TagLib.TagTypes) object and using it's special features:
try
{
TagLib.File file = TagLib.File.Create ("/path/to/music/file.mp3");
TagLib.Id3v2.Tag tag = file.GetTag (TagLib.TagTypes.Id3v2);
// The file contains an ID3v2 tag.
if (tag != null)
foreach (TagLib.Id3v2.AttachedPictureFrame frame in tag.GetFrames ("APIC"))
SomeImageProcess (frame.Picture.Data);
}
catch {...}
Categories: Projects | Metadata | APIs
© 2009 Novell, Inc. All Rights Reserved.