/**
* The sound is load and play in a thread no slow down the engine.
* */
@Override
public void run() {
try {
InputStream in = new BufferedInputStream(this.getClass().getResourceAsStream(this.filename + ".wav"));
Clip clip = AudioSystem.getClip();
clip.open(AudioSystem.getAudioInputStream(in));
if (this.loop){
clip.loop(Clip.LOOP_CONTINUOUSLY);
}
clip.start();
}catch (Exception e){
System.err.println(e);
}
}
Sound.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:Boulder-Dash
作者:
评论列表
文章目录