1

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?

Aziz Shaikh
  • 16,245
  • 11
  • 62
  • 79

2 Answers2

3

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)

PeterCo
  • 910
  • 2
  • 20
  • 36
3

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

Brian Nickel
  • 26,890
  • 5
  • 80
  • 110