I want to add text to a custom tag, to an MP3-file. I tried doing like this, but I can't get the tag to change.
This is my code for now:
TagLib.File f = TagLib.File.Create(@"C:\Users\spunit\Desktop\denna.mp3");
TagLib.Id3v2.Tag t = (TagLib.Id3v2.Tag)f.GetTag(TagTypes.Id3v2);
PrivateFrame p = PrivateFrame.Get(t, "albumtype", true);
p.PrivateData = System.Text.Encoding.Unicode.GetBytes("TAG CHANGED");
f.Tag.Album = "test";
f.Save();
I get the album tag to change, but not the albumtype tag. Am I missing something?
Unfortunately Id3v2 has a set specification which does not allow custom tags, as defined here.
The code you've referenced from another question does work, you just need to include the reader method to return the private frame data.
See also this question on the Unix Stack Exchange where someone encountered the same problem - an alternative solution could be to use the UserDefinedText
tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With