public static void loopClip(Clip clip, int n) { if (clip != null) { clip.stop(); clip.setFramePosition(0); clip.loop(n); } }
// Play or Re-play the sound effect from the beginning, by rewinding. public void play() { if (volume != Volume.MUTE) { if (clip.isRunning()) clip.stop(); // Stop the player if it is still running clip.setFramePosition(0); // rewind to the beginning clip.start(); // Start playing } }
public static void playClip(Clip clip) { if (clip != null) { clip.stop(); clip.setFramePosition(0); clip.start(); } }
public void playAudio() { if (audio != null) { audio.stop(); audio.setFramePosition(0); audio.start(); if (loops.get(0) == true) { audio.loop(Clip.LOOP_CONTINUOUSLY); } } }
public void stopAudio() { pauseAudio(); audio.setFramePosition(0); }