예제 #1
0
 public static void loopClip(Clip clip, int n) {
   if (clip != null) {
     clip.stop();
     clip.setFramePosition(0);
     clip.loop(n);
   }
 }
예제 #2
0
 // 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
   }
 }
예제 #3
0
 public static void playClip(Clip clip) {
   if (clip != null) {
     clip.stop();
     clip.setFramePosition(0);
     clip.start();
   }
 }
예제 #4
0
  public void playAudio() {

    if (audio != null) {
      audio.stop();
      audio.setFramePosition(0);
      audio.start();
      if (loops.get(0) == true) {
        audio.loop(Clip.LOOP_CONTINUOUSLY);
      }
    }
  }
예제 #5
0
 public void stopAudio() {
   pauseAudio();
   audio.setFramePosition(0);
 }