/**
* This method allows to actually play the sound provided from the
* {@link #audioInputStream}
*
* @throws LineUnavailableException
* if the {@link Clip} object can't be created
* @throws IOException
* if the audio file can't be find
*/
protected void play() throws LineUnavailableException, IOException {
// Clip clip = AudioSystem.getClip();
Clip clip = (Clip) AudioSystem.getLine(new Line.Info(Clip.class));
clip.addLineListener(listener);
clip.open(audioInputStream);
try {
clip.start();
listener.waitUntilDone();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
clip.close();
}
audioInputStream.close();
}
AchievementSound.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:agui_framework
作者:
评论列表
文章目录