2

I can read meta information like title, artist, album art and other information from audio files, but I have never been able to successfully write the meta information.

Any have any experiences with this? Are there better libraries than JAudioTagger?

I'd offer some example code, but I've tried a dozen things that didn't work.

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
Corey Ogburn
  • 24,072
  • 31
  • 113
  • 188

1 Answers1

10

Something like

AudioFile audioFile = AudioFileIO.read(testFile);
Tag newTag = audioFile.getTag();
newTag.setField(FieldKey.ALBUM,"October");
newTag.setField(FieldKey.ARTIST,"U2");
audioFile.commit();

but if you are using android you also need to do

TagOptionSingleton.getInstance().setAndroid(true);

because of some bugs with android version of Java

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
  • is the library supported on android ? i read on many threads that writing metadata doesnt work on android ? – h4ck3d Feb 06 '13 at 12:17
  • I think it should work as long as setAndroid() is set, but I haven't tried it, if it does not work please raise bugs on the issue tracker, there are not any currently. – Paul Taylor Feb 12 '14 at 13:24