daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public Audio playMusic() {
  2.         try {
  3.             micros = 0;
  4.             File musicfile = Retris.getTexturepackHandler().getMusic(filepath);
  5.             if(musicfile.exists()) {
  6.                 AudioInputStream audioInput = AudioSystem.getAudioInputStream(musicfile);
  7.                 clip = AudioSystem.getClip();
  8.                 clip.open(audioInput);
  9.                 clip.start();
  10.                 clip.loop(Clip.LOOP_CONTINUOUSLY);
  11.             } else {
  12.                 System.err.println("The musicfile at "" + filepath + "" does not exist!");
  13.             }
  14.         } catch(Exception e) {
  15.             e.printStackTrace();
  16.         }
  17.         return this;
  18.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top