diff --git a/engine/src/core/com/jme3/scene/Mesh.java b/engine/src/core/com/jme3/scene/Mesh.java index 47de19b78..e0d2f44e3 100644 --- a/engine/src/core/com/jme3/scene/Mesh.java +++ b/engine/src/core/com/jme3/scene/Mesh.java @@ -468,7 +468,7 @@ public class Mesh implements Savable, Cloneable { // accepted format for buffers ShortBuffer sib = (ShortBuffer) ib.getData(); - // aquire triangle's vertex indices + // acquire triangle's vertex indices int vertIndex = index * 3; indices[0] = sib.get(vertIndex); indices[1] = sib.get(vertIndex+1); diff --git a/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java b/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java index 6204230f5..1a4e1b5e8 100644 --- a/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java +++ b/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java @@ -69,7 +69,9 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable { private static final Logger logger = Logger.getLogger(LwjglAudioRenderer.class.getName()); - private static final int BUFFER_SIZE = 8192; + // When multiplied by STREAMING_BUFFER_COUNT, will equal 44100 * 2 * 2 + // which is exactly 1 second of audio. + private static final int BUFFER_SIZE = 35280; private static final int STREAMING_BUFFER_COUNT = 5; private final static int MAX_NUM_CHANNELS = 64; @@ -91,7 +93,9 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable { private int reverbFx = -1; private int reverbFxSlot = -1; - private static final float UPDATE_RATE = 0.01f; + // Update audio 20 times per second + private static final float UPDATE_RATE = 0.05f; + private final Thread audioThread = new Thread(this, "jME3 Audio Thread"); private final AtomicBoolean threadLock = new AtomicBoolean(false); diff --git a/engine/src/test/jme3test/audio/TestMusicPlayer.java b/engine/src/test/jme3test/audio/TestMusicPlayer.java index 9f3946732..15a677add 100644 --- a/engine/src/test/jme3test/audio/TestMusicPlayer.java +++ b/engine/src/test/jme3test/audio/TestMusicPlayer.java @@ -39,7 +39,6 @@ import com.jme3.audio.AudioRenderer; import com.jme3.audio.AudioNode; import com.jme3.audio.AudioNode.Status; import com.jme3.audio.Listener; -import com.jme3.audio.QueuedAudioRenderer; import com.jme3.audio.plugins.OGGLoader; import com.jme3.system.AppSettings; import com.jme3.system.JmeSystem; @@ -67,7 +66,7 @@ public class TestMusicPlayer extends javax.swing.JFrame { private void initAudioPlayer(){ AppSettings settings = new AppSettings(true); - settings.setRenderer(null); // force dummy renderer (?) + settings.setRenderer(null); // disable rendering settings.setAudioRenderer("LWJGL"); ar = JmeSystem.newAudioRenderer(settings); ar.initialize(); @@ -189,11 +188,13 @@ public class TestMusicPlayer extends javax.swing.JFrame { try{ return new FileInputStream(selected); }catch (FileNotFoundException ex){ + ex.printStackTrace(); } return null; } }); }catch (IOException ex){ + ex.printStackTrace(); } musicSource = new AudioNode(musicData, key); diff --git a/engine/src/test/jme3test/audio/TestOgg.java b/engine/src/test/jme3test/audio/TestOgg.java index 273b83fdc..fd21b457c 100644 --- a/engine/src/test/jme3test/audio/TestOgg.java +++ b/engine/src/test/jme3test/audio/TestOgg.java @@ -32,7 +32,6 @@ package jme3test.audio; -import com.jme3.asset.plugins.UrlLocator; import com.jme3.audio.AudioNode; import com.jme3.audio.LowPassFilter;