}
}
public static void saveAudioFile(AudioFile audioFile, AudioTag audioTag) {
try {
Tag tagv1 = new ID3v1Tag();
tagv1.setField(FieldKey.TITLE, audioTag.getTitle());
tagv1.setField(FieldKey.ARTIST, audioTag.getArtist());
tagv1.setField(FieldKey.ALBUM, audioTag.getAlbum());
tagv1.setField(FieldKey.YEAR, audioTag.getYear());
tagv1.setField(FieldKey.GENRE, audioTag.getGenre());
tagv1.setField(FieldKey.COMMENT, audioTag.getComment());
audioFile.setTag(tagv1);
Tag tagv23 = new ID3v23Tag();
tagv23.setField(FieldKey.ALBUM, audioTag.getAlbum());
tagv23.setField(FieldKey.TITLE, audioTag.getTitle());
tagv23.setField(FieldKey.ARTIST, audioTag.getArtist());
if (!audioTag.getTrack().isEmpty()) {
tagv23.setField(FieldKey.TRACK, audioTag.getTrack());
}
tagv23.setField(FieldKey.YEAR, audioTag.getYear());
tagv23.setField(FieldKey.GENRE, audioTag.getGenre());
tagv23.setField(FieldKey.COMMENT, audioTag.getComment());
tagv23.setField(FieldKey.ALBUM_ARTIST, audioTag.getAlbumArtist());
audioFile.setTag(tagv23);
AudioFileIO.write(audioFile);
} catch (TagException e) {
e.printStackTrace();