Search code examples
c#mp3unity-game-engineid3

How do I read mp3 tags?


Possible Duplicate:
How to read and write ID3 tags to an MP3 in C#?

I cannot figure out how to read MP3 information in C#. All I need to do is read the artist, title, and album from an MP3, but it does not work. I have tried downloading a few libraries, but the only one I've found that does anything useful can only read some of my MP3s. (Semi-useful one)

In case it's relevant, I'm working in Unity3d, so no Visual Studio stuff.


Solution

  • Keep in mind that not all mp3 files will have tags. There is nothing in the mp3 format that supports tag metadata. The most accepted formats for tags are de-facto formats, most notably ID3v1, ID3v2, and APEv2. These tags, if present, are normally embedded at the beginning or end of the file separate from the mp3 header and frame data.

    In other words, if a library fails to read tags from a given mp3 file, it may well be that there are none, which is not the fault of the library.