废话不多说,直接上代码
jar包
javazoom jlayer 1.0.1
播放音乐的代码
try { File file=new File("F:/123.mp3");//文件路径 FileInputStream fis=new FileInputStream(file); BufferedInputStream bis=new BufferedInputStream(fis); Player player=new Player(bis); player.play();} catch (FileNotFoundException e) { e.printStackTrace();} catch (JavaLayerException e) { e.printStackTrace();}