Advertisement
muse4665

Untitled

Dec 11th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1.     public static void playSound(String path) {
  2.           try {
  3.             Clip clip = AudioSystem.getClip();
  4.             AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File(path));
  5.             clip.open(inputStream);
  6.             clip.start();
  7.           } catch (Exception e) {
  8.             System.err.println(e.getMessage());
  9.           }
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement