public static void loopClip(Clip clip, int n) { if (clip != null) { clip.stop(); clip.setFramePosition(0); clip.loop(n); } }
public static void playClip(Clip clip) { if (clip != null) { clip.stop(); clip.setFramePosition(0); clip.start(); } }
public void interrupt() { if (clip != null) clip.stop(); synchronized (notificationMutex) { playing = false; queue.clear(); notificationMutex.notifyAll(); } }
public void playPause() { if (clip != null) { if (playState == PLAYING) { clip.stop(); playState = PAUSED; } } }
public void playStop() { if (clip != null) { if (playState == PLAYING || playState == PAUSED) { clip.stop(); clip.close(); playState = STOPPED; } } }
public static void stopClip(Clip clip) { if (clip != null) { clip.stop(); // clip.close(); } }