How to get the Properties of a *.mp3 File in C#

You can examine the ID3 tag of the mp3s. The taglib-sharp library is great for doing so. Source code available (here). Example code:

TagLib.File tagFile = TagLib.File.Create(pathtofile);
string artist = tagFile.Tag.FirstAlbumArtist;
string album = tagFile.Tag.Album;
string title = tagFile.Tag.Title;
...

Not sure if tag-lib supports .wma though… Tag-lib can however be ported to silverlight (if needed).

Leave a Comment