Package com.jme3.audio

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


        }
    }

    // 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

        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

        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

  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

     * @return
     */
    private AudioNode findAudio(Spatial spat) {
        if (spat instanceof AudioNode) {
            //spat is an AudioNode
            AudioNode em = (AudioNode) spat;
            //getting the UserData TrackInfo so check if it should be attached to this Track
            TrackInfo t = (TrackInfo) em.getUserData("TrackInfo");
            if (t != null && t.getTracks().contains(this)) {
                return em;
            }
            return null;

        } else if (spat instanceof Node) {
            for (Spatial child : ((Node) spat).getChildren()) {
                AudioNode em = findAudio(child);
                if (em != null) {
                    return em;
                }
            }
        }
View Full Code Here

    }

    @Override
    public void initEvent(Application app, Cinematic cinematic) {
        super.initEvent(app, cinematic);
        audioNode = new AudioNode(app.getAssetManager(), path, stream);
        audioNode.setPositional(false);
        setLoopMode(loopMode);
    }
View Full Code Here

    this.soundfile = soundfile;
  }

  @Override
  public void internalLoadSceneObject() {
    sceneObject = new AudioNode(GlobalObjectStore.<AssetManager>getObject(AssetManager.class), soundfile, true);
  }
View Full Code Here

    explosion.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 5, 0));
    explosion.getParticleInfluencer().setVelocityVariation(0.4f);

    spatial = explosion;
    Random rand = new Random();
    sound = new AudioNode(world.getAssetManager(), String.format("Sound/Effects/Explosion%d.ogg", rand.nextInt(4) + 1));
    sound.setLooping(false);
    sound.setVolume(0.5f);
    sound.setPositional(true);
    sound.setLocalTranslation(location);
    renderer = world.getAudioRenderer();
View Full Code Here

        // init Audio ----------------------------------
        // edited by floh -- 31/10/2011
        ar = JmeSystem.newAudioRenderer(settings);
        ar.initialize();

        listener = new Listener();
        ar.setListener(listener);
       
        // init StateManager ----------------------------
        stateManager = new AppStateManager(this);
       
View Full Code Here

TOP

Related Classes of com.jme3.audio.AudioNode

Copyright © 2018 www.massapicom. 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.