예제 #1
0
 public static void loopClip(Clip clip, int n) {
   if (clip != null) {
     clip.stop();
     clip.setFramePosition(0);
     clip.loop(n);
   }
 }
예제 #2
0
 public static void playClip(Clip clip) {
   if (clip != null) {
     clip.stop();
     clip.setFramePosition(0);
     clip.start();
   }
 }
예제 #3
0
 public void interrupt() {
   if (clip != null) clip.stop();
   synchronized (notificationMutex) {
     playing = false;
     queue.clear();
     notificationMutex.notifyAll();
   }
 }
예제 #4
0
  public void playPause() {

    if (clip != null) {
      if (playState == PLAYING) {

        clip.stop();
        playState = PAUSED;
      }
    }
  }
예제 #5
0
  public void playStop() {

    if (clip != null) {
      if (playState == PLAYING || playState == PAUSED) {

        clip.stop();
        clip.close();
        playState = STOPPED;
      }
    }
  }
예제 #6
0
 public static void stopClip(Clip clip) {
   if (clip != null) {
     clip.stop();
     // clip.close();
   }
 }