public static void playSound() throws Exception {
String windowsPath = System.getenv("WINDIR");
String audioFile = windowsPath + "/Media/tada.wav";
Clip clip;
File soundFile = new File(audioFile);
Line.Info linfo = new Line.Info (Clip.class);
Line line = AudioSystem.getLine (linfo);
clip = (Clip) line;
AudioInputStream ais = AudioSystem.getAudioInputStream(soundFile);
clip.open (ais);
clip.start();
Thread.sleep(1000);
}
String windowsPath = System.getenv("WINDIR");
String audioFile = windowsPath + "/Media/tada.wav";
Clip clip;
File soundFile = new File(audioFile);
Line.Info linfo = new Line.Info (Clip.class);
Line line = AudioSystem.getLine (linfo);
clip = (Clip) line;
AudioInputStream ais = AudioSystem.getAudioInputStream(soundFile);
clip.open (ais);
clip.start();
Thread.sleep(1000);
}
댓글 없음:
댓글 쓰기