2. Download MP3 Plugin from : http://www.oracle.com/technetwork/java/javase/download-137625.html or http://pscode.org/lib/mp3plugin.jar
3. Code for playing the mp3 file is like :
import javax.media.Manager; import javax.media.Player; import javax.media.Format; import javax.media.MediaLocator; import javax.media.PlugInManager; import javax.media.format.AudioFormat; ... Format input1 = new AudioFormat(AudioFormat.MPEGLAYER3); Format input2 = new AudioFormat(AudioFormat.MPEG); Format output = new AudioFormat(AudioFormat.LINEAR); Format[] formatIn = new Format[2]; formatIn[0] = input1; formatIn[1] = input2; Format[] out = new Format[1]; out[0] = output; File mp3file = new File("a.mp3"); PlugInManager.addPlugIn( "com.sun.media.codec.audio.mp3.JavaDecoder", formatIn, out, PlugInManager.CODEC ); try{ Player player = Manager.createPlayer(new MediaLocator(mp3file.toURI().toURL())); player.start(); } catch(Exception ex){ ex.printStackTrace(); } ...