Neil Siegfried
Neil Siegfried

Reputation: 31

Is there a way to check what tags are in a file using taglib-sharp? Something like TagTypes.Id3v1.Exists?

I've been using taglib-sharp to remove ID3 tags from MP3 files. Everything seems pretty straight forward besides knowing what tags there is in the file.

Upvotes: 1

Views: 1632

Answers (1)

Brian Nickel
Brian Nickel

Reputation: 27550

There's a property TagLib.File.TagTypesOnDisk that returns the tag types that were in the tag when it was first read or last saved. There's also TagLib.File.TagTypes which returns the tag types that are currently in the file representation and will be written when Save() is called. The difference between the two is generally any new tag types that a file format might add by default.

Removing those tags is simply a matter of calling TagLib.File.RemoveTags before saving. E.g. file.RemoveTags(TagLib.TagTypes.Id3v1)

Upvotes: 0

Related Questions