JAudioTagger and Android - Change a value in an mp3?

会有一股神秘感。 提交于 2019-12-01 09:18:31

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/5447145/jaudiotagger-and-android-change-a-value-in-an-mp3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!