package service;
import java.net.URISyntaxException;
import java.net.URL;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
public class SoundUtil {
public static void playSound() {
try {
URL url = null;
try {
url = PSAUtil.class.getResource("/sounds/beep-6.wav").toURI().toURL();
} catch (URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
AudioInputStream audioInputStream = AudioSystem
.getAudioInputStream(url);
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.start();
} catch (Exception e) {
e.printStackTrace();
}
}
}