문제

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).

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top