Dear All,
I’ve been unable to get a sound to fade by moving its position.
I’m using JOAL release build 1.1 b01 for Windows.
Here’s a snippet of code that doesn’t work:
if (e.getSource() == playButton) {
al.alSourcePlay(source[0]);
float step = 20.0f;
float zPos = 0.0f;
for(int i=0; i < 50; i++) {
zPos += step;
float[] pos = new float[]{0, 0, zPos};
al.alSourcefv(source[0], AL.AL_POSITION, pos, 0);
try {
Thread.sleep(250); // sleep for 0.25 secs
}
catch(InterruptedException ex) {}
}
}
Any suggestions about how to get it to work?
- Andrew