Advertisement
Guest User

Untitled

a guest
May 25th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import javax.sound.sampled.AudioInputStream;
  2. import javax.sound.sampled.AudioSystem;
  3. import javax.sound.sampled.Clip;
  4.  
  5. try{
  6. AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(this.getClass().getResource("assets/sounds/bgm/ingame.wav"));
  7. Clip clip = AudioSystem.getClip();
  8. clip.open(audioInputStream);
  9. clip.start();
  10. clip.loop(Clip.LOOP_CONTINUOUSLY); //IF NEEDED LOOP
  11. }
  12. catch(Exception e){}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement