Taglib 锐利仅保存 ID3v2

发布于 2024-12-21 04:38:38 字数 121 浏览 3 评论 0原文

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

献世佛 2024-12-28 04:38:38

创建 File 对象时添加这些标记是为了方便。删除新创建的标签的正确方法是在调用Save之前执行以下命令:

file.RemoveTags (file.TagTypes & ~file.TagTypesOnDisk);

来源

These tags are added for convenience when the File object is created. The correct way to remove newly created tags is to perform the following command before calling Save:

file.RemoveTags (file.TagTypes & ~file.TagTypesOnDisk);

Source

月竹挽风 2024-12-28 04:38:38

谢谢布莱恩。
C#“& ~”语法对于 VB.NET 用户来说并不那么明显:

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

@user1098787:
如果要编写特定的 id3v2 版本,可以使用此命令

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

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

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

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

@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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文