taglib-sharpid3v2

TagLib# Exception on File.Create


I am trying to use Taglib# to add id3v2 tags to a file. I have it working on some files - however, on certain files it will fail. (Possibly due to file corruption).

if (ext == ".aiff" || ext==".aif"){
     //force reading of aiff files
    file = TagLib.File.Create(filename, "audio/aiff",TagLib.ReadStyle.None);
}

The Create() call throws this exception: Provided data does not start with the file identifier

Based on the documentation, I'm not sure how I can fix this (or add a file identifier).


Solution

  • Not sure there was a way to do this. The solution was to run the files through FFMPEG and create new AIFF so that they would produce PROPER AIFF files. Then TagLib# works properly.