Exemple #1
0
 @Override
 public void simpleInitApp() {
   src = new AudioNode(assetManager, "Sounds/Effects/Foot steps.ogg", true);
   src.setVolume(10);
   System.out.println("Playing all frequencies unfiltered");
   src.play();
 }
Exemple #2
0
  private void initAudio() {
    bgAudio = new AudioNode(assetManager, "Sound/Background.wav", false);
    bgAudio.setLooping(true);
    bgAudio.setVolume(3);
    rootNode.attachChild(bgAudio);
    bgAudio.play();

    explosionAudio = new AudioNode(assetManager, "Sound/Explosion.wav", false);
    explosionAudio.setLooping(false);
    explosionAudio.setVolume(0.5f);
    rootNode.attachChild(explosionAudio);

    AudioNode accelAudio = new AudioNode(assetManager, "Sound/Fire4.wav", false);
    accelAudio.setLooping(true);
    accelAudio.setVolume(10);
    spaceship.initAudio("Accelerate", accelAudio);

    AudioNode laserAudio = new AudioNode(assetManager, "Sound/Laser.wav", false);
    laserAudio.setLooping(false);
    laserAudio.setVolume(1);
    spaceship.initAudio("Laser", laserAudio);
  }
Exemple #3
0
 @Override
 public void simpleUpdate(float tpf) {
   if (src.getStatus() != src.getStatus().Playing) {
     filterIsOn = !filterIsOn; // toggle
     src = new AudioNode(assetManager, "Sounds/Effects/Foot steps.ogg", true);
     if (filterIsOn) {
       src.setDryFilter(new LowPassFilter(.5f, .1f));
       System.out.println("Playing with low pass filter");
     } else {
       src.setDryFilter(new LowPassFilter(1f, 1f));
       System.out.println("Playing all frequencies unfiltered");
     }
     src.setVolume(10);
     src.play();
   }
 }