mpatric / mp3agic

A java library for reading mp3 files and reading / manipulating the ID3 tags (ID3v1 and ID3v2.2 through ID3v2.4).
MIT License
1.2k stars 310 forks source link

Cannot edit ID3v2Tags - Example doesn't work #154

Open carlosrd opened 6 years ago

carlosrd commented 6 years ago

Hi

The example shown in the README of the repo for Setting ID3v2Tags doesn't work. I'm trying to editing some fields but unless you remove the previous ID3v2Tag (call removeID3vTag) from the mp3 file and set a new one, the changes doesn't take effect and the outputed mp3 is the same as the original.

But If I remove the tag to save my changes, I lose the previous data when I only want to update some data. The only workaround that I found to this is to copy manually all the previous fields in the new tag and then update it. For only update one or two fields, I have to copy ALL the rest to maintain all the previous information, what it shouldn't be necessary

I tried it with latest version of Java 8

Thank you

RipplB commented 5 years ago

Don't copy it manually, copy the whole tag (tagOfYourVersion tag = mp3file.getID3v2Tag() ), than call the remove functions, edit your tag and reattach it.