@Override public void simpleInitApp(){ assetManager.registerLocator("https://web.archive.org/web/20170625151521if_/http://www.vorbis.com/music/", UrlLocator.class); AudioNode audioSource = new AudioNode(assetManager, "Lumme-Badloop.ogg", AudioData.DataType.Stream); audioSource.setPositional(false); audioSource.setReverbEnabled(false); audioSource.play(); }
DataType.Buffer); waves.setLooping(true); waves.setReverbEnabled(true); if (uw) { waves.setDryFilter(new LowPassFilter(0.5f, 0.1f));
soundnode.setReverbEnabled(true); soundnode.setLooping(looping); soundnode.setVolume((float)volume); soundnode.setReverbEnabled(true); soundnode.setRefDistance(50f);
/** * Plays a positional sound in an given tile * * @param x x coordinate * @param y y coordinate * @param soundFile the sound file */ public void playSoundAtTile(int x, int y, String soundFile) { // We might cache these per file? Then they would be persistent, just move them, does it matter? // Since creation of new objects and all, I don't know if they stay in the scene graph.. AudioNode audio = new AudioNode(assetManager, ConversionUtils.getCanonicalAssetKey(AssetsConverter.SOUNDS_FOLDER + soundFile), AudioData.DataType.Buffer); audio.setPositional(true); audio.setReverbEnabled(false); audio.setLocalTranslation(x, 0, y); worldNode.attachChild(audio); audio.play(); }
private void initAudio() { org.lwjgl.input.Mouse.setGrabbed(false); music = new AudioNode(assetManager, "Sound/Effects/Beep.ogg", false); rootNode.attachChild(music); audioRenderer.playSource(music); music.setPositional(true); music.setVolume(1f); music.setReverbEnabled(false); music.setDirectional(false); music.setMaxDistance(200.0f); music.setRefDistance(1f); //music.setRolloffFactor(1f); music.setLooping(false); audioRenderer.pauseSource(music); }