Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void playSound(String path) {
- try {
- Clip clip = AudioSystem.getClip();
- AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File(path));
- clip.open(inputStream);
- clip.start();
- } catch (Exception e) {
- System.err.println(e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement