1个回答
展开全部
播放音乐的代码 了解一下 可以直接加到小游戏里
package com.music.test;
import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;
import java.io.*;
public class Music {
private String music;
private Player player;
public Music() throws FileNotFoundException, JavaLayerException {
FileInputStream file = new FileInputStream("e:/闹钟.mp3");
BufferedInputStream name = new BufferedInputStream(file);
player = new Player(name);
player.play();
}
public static void main(String[] args) throws FileNotFoundException, JavaLayerException{
new Music();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |