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.
TagLib# Exception on File.Create
-
15-10-2022 - |
質問
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).
解決
他のヒント
Based on my own experiments, TagLib Sharp also throws exception on the Create()
method "if" corresponding file has no ID3 tag at all. I just tested with some files, removed tags using TagLib Sharp, then tried the Create()
method on the same file; same exception happened.
所属していません StackOverflow