1

I have encountered a very strange problem while using Taglib sharp. I am changes the rating of video file by using code shown below.

        TagLib.File file = TagLib.File.Create(FULLFILEPATH);
        TagLib.Tag Tag = file.GetTag(TagTypes.Id3v2);
        TagLib.Id3v2.PopularimeterFrame frame = TagLib.Id3v2.PopularimeterFrame.Get((TagLib.Id3v2.Tag)Tag, "WindowsUser", true);
        frame.Rating = 255;
        file.Save();

After saving file when i open the detail tab of video file from properties, rating seems not to be change. But when i again read that file programmatically in c# and check its rating value, it is 255. Why this happening and why rating value is not updating ?

4

1 回答 1

3

查看使用 VB.NET + WinForms 检查音乐文件评级的答案,可能的原因是您的标签可能被保存为 iD3v2.4 并且 Windows 仅支持 iD3v2.3。

您可以使用以下代码强制 TagLib# 将您的标签保存为 iD3v2.3:

TagLib.Id3v2.Tag.DefaultVersion = 3;
TagLib.Id3v2.Tag.ForceDefaultVersion = true;
于 2013-09-09T17:36:45.990 回答