JAudioTagger and Android - Change a value in an mp3?

后端 未结 1 1298
不思量自难忘°
不思量自难忘° 2021-01-15 15:42

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.

相关标签:
1条回答
  • 2021-01-15 16:02

    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

    0 讨论(0)
提交回复
热议问题