Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Audio playMusic() {
- try {
- micros = 0;
- File musicfile = Retris.getTexturepackHandler().getMusic(filepath);
- if(musicfile.exists()) {
- AudioInputStream audioInput = AudioSystem.getAudioInputStream(musicfile);
- clip = AudioSystem.getClip();
- clip.open(audioInput);
- clip.start();
- clip.loop(Clip.LOOP_CONTINUOUSLY);
- } else {
- System.err.println("The musicfile at "" + filepath + "" does not exist!");
- }
- } catch(Exception e) {
- e.printStackTrace();
- }
- return this;
- }
Add Comment
Please, Sign In to add comment