Ejemplo n.º 1
0
 public static void loopClip(Clip clip, int n) {
   if (clip != null) {
     clip.stop();
     clip.setFramePosition(0);
     clip.loop(n);
   }
 }
Ejemplo 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
   }
 }
Ejemplo n.º 3
0
 public static void playClip(Clip clip) {
   if (clip != null) {
     clip.stop();
     clip.setFramePosition(0);
     clip.start();
   }
 }
Ejemplo n.º 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);
      }
    }
  }
Ejemplo n.º 5
0
 public void stopAudio() {
   pauseAudio();
   audio.setFramePosition(0);
 }