本文介绍了Taglib 锐利保存仅 ID3v2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用 TagLib 的新手.我正在尝试仅在文件中保存特定版本的标签.每次我保存标签时,都会创建 ID3v1 和 ID3v2.有没有办法阻止这种情况发生?我可以选择我想保存哪一个.save 函数不接受任何参数,所以有什么想法吗?

I'm new using TagLib sharp. I'm trying to save ONLY an specific version of the tag inside the file. Everytime I save the tag both ID3v1 and ID3v2 get created. Is there a way to stop this from happening? Can I choose which one I want to save. The save function doesn't take any arguments, so any ideas?

推荐答案

谢谢 Brian.
C#& ~"语法对于 VB.NET 用户来说不是那么明显:

Thank you Brian.
The C# "& ~" syntax is not that obvious for VB.NET users:

file.RemoveTags(file.TagTypes And Not file.TagTypesOnDisk)

@user1098787:
如果你想写一个特定的id3v2版本,你可以使用这个命令

@user1098787:
If you want to write a specific id3v2 version, you can use this commands

TagLib.Id3v2.Tag.DefaultVersion = 3
TagLib.Id3v2.Tag.ForceDefaultVersion = True

DefaultVersion 的可能值为 2 (id3v2.2)、3 (id3v2.3) 或 4 (id3v2.4)

Possible values for DefaultVersion are 2 (id3v2.2), 3 (id3v2.3) or 4 (id3v2.4)

这篇关于Taglib 锐利保存仅 ID3v2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-07 13:44