I opted to use jaudiotagger as I understood it would work on the Android platform. I have an MP3 file that I want to add some tags to, but for some reason the commit() method does not see to work. There are also no errors or exceptions thrown.
I first make a copy of the file to my app’s cache area just to avoid any permission-related issues. The file exists and is writeable:
File tempFile;
// copy the original file to local cache
tempFile.exists() returns true
tempFile.canWrite() returns true
I then use this code to add/change the tags:
MP3File f = (MP3File) AudioFileIO.read(tempFile); // I've also tried using AudioFile instead of MP3File
Tag t = f.getTagOrCreateDefault(); // I've also tried using AbstractID3v2Tag instead of Tag
t.setField(FieldKey.YEAR, "1976");
t.setField(FieldKey.GENRE, "Television");
f.commit(); // no errors and no exceptions
I then download the MP3 file to my desktop for inspection. Simply looking at the details of the file using Windows Explorer shows that none of the tags were added. I tried a different MP3 file and it worked (i.e., the tags were added/changed as expected). I then used Mp3tag to see what might be the difference between the two MP3 files. It appears that the MP3 file that does not work did not have an existing ID3 structure before I attempted to make changes to it, and the MP3 file that does work did have an existing ID3 structure before I attempted to make changes to it.
So I guess my question is: does jaudiotagger work with MP3 files that do not already have an existing ID3 structure, and if it does, what do I need to do differently?