Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: c# sharpdevelop taglib mp3 header tags  (Read 5746 times)

0 Members and 1 Guest are viewing this topic.

zaryk

  • Guest
c# sharpdevelop taglib mp3 header tags
« on: April 20, 2008, 01:28:19 PM »
Hey, im trying to incorporate the the dll, taglib, known to be useful to retrieve mp3 header tags.  Everything is fine until I run the program, and I get this.

Code: [Select]
Exception TagLib.CorruptFileException was thrown in debuggee:
First MPEG header could not be found.


I have the code set to only effect mp3's, and the code im trying to use is.

Code: [Select]
string path = @"" + info.Root + "Documents and Settings\\" + System.Environment.UserName + "\\My Documents";
    foreach (string str2 in Directory.GetDirectories(path))
    {
        foreach (string str3 in Directory.GetFiles(str2))
        {


            if (str3.Contains(".mp3"))
            {
            TagLib.File file = TagLib.File.Create (str3);                  //<---------says error occurs here
   
            this.libraryGrid.Rows.Add(file.Tag.Title, "", "", "", "" );

Any ideas? thanks.