Hi,
I noticed that the audio would start to stutter/lag if I put all of the frequently updated positional nodes to stop.
So I started back from Hello Audio, created two positional AudioNode and made their position change with simpleUpdate(), put another node which is not updated. And the same thing happens, if I stop both moving nodes, the last one will start to stutter and the apps starts to freeze.
EDIT: The update section is actually irrelevant. It seems that as long as I have at least one positional sound playing it’s fine, but when all of them are paused/stopped, the issue will start.
The initAudio()
[java]private void initAudio() {
assetManager.registerLocator(“C:/”, FileLocator.class);
soundpos1 = new AudioNode(assetManager, “ASSETS/SOUNDS/BGM/esismono.wav”);
soundpos1.setPositional(true);
soundpos1.setMaxDistance(50f);
soundpos1.setLocalTranslation(-200, 0, -200);
soundpos1.setLooping(true);
soundpos1.play();
soundpos2 = new AudioNode(assetManager, “ASSETS/SOUNDS/BGM/gerudomono.wav”);
soundpos2.setPositional(true);
soundpos2.setMaxDistance(50f);
soundpos2.setLocalTranslation(-200, 0, -200);
soundpos2.setLooping(true);
soundpos2.play();
soundnopos = new AudioNode(assetManager, “ASSETS/SOUNDS/BGM/dafthbfs.wav”);
soundnopos.setPositional(false);
soundnopos.setVolume(0.3f);
soundnopos.setLooping(true);
soundnopos.play();
}[/java]
The simpleUpdate()
[java]@Override
public void simpleUpdate(float tpf) {
if (soundpos1.getStatus() == AudioNode.Status.Playing || soundpos2.getStatus() == AudioNode.Status.Playing){
if (soundpos1.getLocalTranslation() == new Vector3f(-200,0,-200)){
soundpos1.setLocalTranslation(new Vector3f(-200,0,200));
soundpos2.setLocalTranslation(new Vector3f(-200,0,200));
// soundMan.setSoundPosition(soundpos3, new Vector3f(-200,0,200));
} else if (soundpos1.getLocalTranslation() == new Vector3f(-200,0,200)){
soundpos1.setLocalTranslation(new Vector3f(200,0,200));
soundpos2.setLocalTranslation(new Vector3f(200,0,200));
// soundMan.setSoundPosition(soundpos3, new Vector3f(200,0,200));
} else if (soundpos1.getLocalTranslation() == new Vector3f(200,0,200)){
soundpos1.setLocalTranslation(new Vector3f(-200,0,200));
soundpos2.setLocalTranslation(new Vector3f(-200,0,200));
// soundMan.setSoundPosition(soundpos3, new Vector3f(-200,0,200));
} else {
soundpos1.setLocalTranslation(new Vector3f(-200,0,-200));
soundpos2.setLocalTranslation(new Vector3f(-200,0,-200));
// soundMan.setSoundPosition(soundpos3, new Vector3f(-200,0,-200));
}
}
}[/java]
The whole class if needed: http://pastebin.com/LZ0AdcST
Do you have any idea why that would happen?
Can’t really reproduce this issue. I tried your test case and then stopped 2 of the 3 sounds. The other sound continued playing as usual and the app did not slow down or freeze at all.
I have the same problem with all audio examples when used on my linux machine. Even the example audio code stutters for me.
I tried it on someone else’s computer and it works fine.
I’m using Windows 7 and the Java JDK 7u4 x64, could it come from any of that?
@marvinssdf said:
I tried it on someone else's computer and it works fine.
I'm using Windows 7 and the Java JDK 7u4 x64, could it come from any of that?
I used the same configuration for testing
Well, then I really don’t know what’s causing this… I’m not using any of the nightly builds so if you tried while using one it may be the reason why it didn’t bug but that’s unlikely.
Then again, if it works on the main machines that’s not so bad, but it’s still a bit of a pain.
Are you using stable or beta1? There were some fixes done to the audio system since beta1 that might have fixed the issue you were having.
I’m using the libraries from the windows beta SDK.
EDIT: I just tried using the latest nightly build, same result.