Examples of AudioNode


Examples of com.jme3.audio.AudioNode

    private boolean isActive;
    private AudioNode music;

    public BackgroundMusicAppState(GameNameGoesHere myApp) {
        music = new AudioNode(myApp.getAssetManager(), "Sounds/Music/bg1.ogg", true);
        music.setLooping(false);
        music.setVolume(0.25f);
        music.setPositional(false);
        music.setDirectional(false);
    }
View Full Code Here

Examples of com.jme3.audio.AudioNode

    // loads all sound effects which will be needed for that level
    private void loadSoundEffects(MonkeySound[] sounds) {

        for (MonkeySound s : sounds) {
            AudioNode soundNode = new AudioNode(assetManager, s.path());
            soundMap.put(s, soundNode);
        }
    }
View Full Code Here

Examples of com.jme3.audio.AudioNode

    // load all music which will be streamed
    public void loadMusic(MonkeySound[] music) {

        for (MonkeySound s : music) {
            if (s != null) {
                AudioNode musicNode = new AudioNode(assetManager, s.path(), true);
                musicNode.setLooping(true);
                musicNode.setPositional(false);
                musicNode.setDirectional(false);

                soundMap.put(s, musicNode);
            }
        }
    }
View Full Code Here

Examples of com.jme3.audio.AudioNode

            soundMap.remove(monkeySound);
        }
    }

    public void play(MonkeySound sound) {
        AudioNode toPlay = soundMap.get(sound);

        if (toPlay != null) {
            if (sound.isMusic()) {

                if (myApp.getUserSettings().isMusicMuted()) {
                    return;
                }

                toPlay.play();
            } else {

                if (myApp.getUserSettings().isSoundFXMuted()) {
                    return;
                }

                toPlay.playInstance();
            }
        }
    }
View Full Code Here

Examples of com.jme3.audio.AudioNode

    }

    // pause the music
    public void pause(MonkeySound sound) {

        AudioNode toPause = soundMap.get(sound);

        if (toPause != null) {
            audioRenderer.pauseSource(toPause);
        }
    }
View Full Code Here

Examples of com.jme3.audio.AudioNode

        }
    }

    // if paused it will play, if playing it will be paused
    public void togglePlayPause(MonkeySound sound) {
        AudioNode toToggle = soundMap.get(sound);

        if (toToggle != null) {
            if (toToggle.getStatus() == AudioNode.Status.Paused
                    || toToggle.getStatus() == AudioNode.Status.Stopped) {
                play(sound);
            } else {
                pause(sound);
            }
        }
View Full Code Here

Examples of com.jme3.audio.AudioNode

        }
    }

    // tries to stop a sound, will probably only work for streaming music though
    void stop(MonkeySound sound) {
        AudioNode toStop = soundMap.get(sound);

        toStop.stop();
    }
View Full Code Here

Examples of com.jme3.audio.AudioNode

        water.setRefractionStrength(0.2f);

        water.setWaterHeight(initialWaterHeight);
        uw = cam.getLocation().y < waterHeight;

        waves = new AudioNode(assetManager, "Sounds/Environment/Ocean Waves.ogg", false);
        waves.setLooping(true);
        waves.setReverbEnabled(true);
        if (uw) {
            waves.setDryFilter(new LowPassFilter(0.5f, 0.1f));
        } else {
View Full Code Here

Examples of com.jme3.audio.AudioNode

        water.setRefractionStrength(0.2f);
       
        water.setWaterHeight(initialWaterHeight);
        uw = cam.getLocation().y < waterHeight;
       
        waves = new AudioNode(assetManager, "Sounds/Environment/Ocean Waves.ogg", false);
        waves.setVolume(0.15f);
        waves.setLooping(true);
        waves.setReverbEnabled(true);
        if (uw) {
            waves.setDryFilter(new LowPassFilter(0.5f, 0.1f));
View Full Code Here

Examples of com.jme3.audio.AudioNode

  public void initAudio() {
    //System.out.println("############# AUDIO: " + audio_ambient.getStatus());
    if (polluxApp != null) {
      System.out.println("################# INIT AUDIO ####################");
       
      audio_ambient = new AudioNode(app.getAssetManager(), "Sound/Ambient_test.ogg", false);
      audio_ambient.setLooping(true)// for continuous playing
      audio_ambient.setVolume(0.2f);
      polluxApp.getRootNode().attachChild(audio_ambient);
      polluxApp.getAudioRenderer().playSource(audio_ambient);
      System.out.println("############# AUDIO: " + audio_ambient.getStatus());
     
      audio_click = new AudioNode(app.getAssetManager(), "Sound/Click_test.wav", false);
      audio_click.setLooping(false);
      audio_click.setVolume(2);
      polluxApp.getRootNode().attachChild(audio_click);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.