André L. S. Softwares Development, Technology and Games

23May/091

Manipulating ID3 Tags of MP3 files

This post will teach you how to manipulate ID3 tags of MP3 files using Java Jid3Lib Tag Library. First, download the jar file from http://javamusictag.sourceforge.net/.

The code below will show you how to get any information of MP3 file:

try {
    MP3File mp3 = new MP3File("D:\\Musics\\MP3\\ACDC\\ACDC - Back In Black.mp3");
    System.out.println("Album:" + mp3.getID3v2Tag().getAlbumTitle());
    System.out.println("Band:" + mp3.getID3v2Tag().getLeadArtist());
    System.out.println("Composer:" + mp3.getID3v2Tag().getAuthorComposer());
    System.out.println("Year:" + mp3.getID3v2Tag().getYearReleased());
} catch (Exception e) {
	e.printStackTrace();
}

The result:

Album: Back in Black
Band: AC/DC
Composer: Angus Young/Brian Johnson/Malcolm Young
Year:

To change any information of any ID3 tags, try the code bellow:

mp3.getID3v2Tag().setYearReleased("1980");
mp3.save();

This library has many methods that help you to customize any MP3 file.

Comments (1) Trackbacks (0)
  1. Hello, can you please post some more information on this topic? I would like to read more.


Leave a comment


No trackbacks yet.