Exemple #1
0
 public static void playClip(Clip clip) {
   if (clip != null) {
     clip.stop();
     clip.setFramePosition(0);
     clip.start();
   }
 }
Exemple #2
0
 public static void loopClip(Clip clip, int n) {
   if (clip != null) {
     clip.stop();
     clip.setFramePosition(0);
     clip.loop(n);
   }
 }
Exemple #3
0
  public void playPause() {

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

        clip.stop();
        playState = PAUSED;
      }
    }
  }
Exemple #4
0
  public void playStop() {

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

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