views:

38

answers:

1

I know formats such as mp3, ogg and flac have tags such as artist, album etc. I would like to extract that information if available. Right now i am using ffmpeg to conv the audio so a way to do it within ffmpeg is convenient but not required. My website is writing in C# ASP.NET. I dont mind parsing cmd line output or using a lib call.

What can i use to read the tags for all of these formats?

+1  A: 

For the specific three you asked, there are two different tagging schemes.

MP3 is typically tagged with ID3; ID3v2 is the most flexible of the bunch. There are quite a few versions of ID3, and you'll find varying player support. id3lib is the reference library for ID3, and I'm sure there is a managed solution -- since "ID3" is pretty good Google fodder. By searching StackOverflow with "ID3" I found a lot of recommendations for TagLib Sharp.

Ogg Vorbis (be careful to point out Vorbis) and FLAC share a tagging format called Vorbis Comments. More Google fodder.

Long and short: You're not looking at one solution, depending on how many formats you want to support. Each tends to do things their own way. Another thing you'll run into as you deploy is player inconsistencies -- for a long time when I wrote code that tackled this, iTunes and foobar2000 did Album Artist differently. I haven't coded this stuff in a while, so it's tough to say where players are today with compatibility.

Best thing to do is grab a few representative samples and jump into your favorite binary editor, to see how different players save their tags. Don't worry, though: many before you have ventured into tagland.

Jed Smith
TagLib-Sharp works with ogg and looks like other vorbis files. The libs looks very well designed.
acidzombie24