ben
ben

Reputation: 1122

JaudioTagger doesn't acually change tag fields

I'm building an application that edits tags on mp3 files using JAudioTagger. The only problem is that the mp3 file's fileds don't change when i open the file in Google Music app.

            TagOptionSingleton.getInstance().setAndroid(true);
            File tempFile = new File(Environment.getExternalStoragePublicDirectory("smoething"), songname + ".mp3");
            AudioFile audioFile = AudioFileIO.read(tempFile);
            Tag tag = audioFile.getTag();
            tag.setField(FieldKey.ARTIST, "artist"); // when i open music app the artist is "unknown"
            audioFile.setTag(tag); // even without this i'm getting the same result
            audioFile.commit();        

According to this answer the code should be working fine but for some reason it doesn't. Does someone have a clue what i have done wrong?

Upvotes: 2

Views: 810

Answers (1)

ben
ben

Reputation: 1122

So i found out that the problem was with the method commit() (it just didn't worked) so i used AudioFileIO.write(audioFile) instead that does the same thing.

Upvotes: 2

Related Questions