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

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

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

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

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