Вот в лаунчере для майнкрафта надыбал. Сюдя по этой программе куда написать имя файла который будет воспроизводится. Пусть имя файла будет electro.mp3.
package net.minecraft;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import javazoom.jl.player.Player;
public class MusPlay {
private String filename;
private Player player;
// constructor that takes the name of an MP3 file
public MusPlay(String filename) {
this.filename = filename;
}
public void close() { if (player != null) player.close(); }
// play the MP3 file to the sound card
public void play() {
try {
InputStream is=getClass().getResourceAsStream(setting.iMusicname);
BufferedInputStream bis = new BufferedInputStream(is);
player = new Player(is);
}
catch (Exception e) {
System.out.println("Problem playing file " + filename);
System.out.println(e);
}
// run in new thread to play in background
new Thread() {
public void run() {
try { player.play(); }
catch (Exception e) { System.out.println(e); }
}
}.start();
}
}