The following code does not work under Linux when using the OpenJDK JRE…it will play one sound effect, but then essentially “hangs” the thread, and no more sound effects can be played.
I am struggling to resolve this problem; essentially, it works on all other JRE’s for Mac and Windows, but dies under OpenJDK…
The LineEvent STOP gets fired and I call my stop() method to ready the Sound for playing again. It either dies within setFramePosition() or setMicrosecondPosition() from what I can discern:
public void update(LineEvent e) {
if (e.getType() == LineEvent.Type.STOP) {
stop();
debug("Stopping Clip "+sfxURL.toString());
}
}
public void stop() {
debug("stop() call for "+sfxURL.toString());
sfxClip.stop();
sfxClip.setFramePosition(0);
sfxClip.setMicrosecondPosition(0);
synchronized(sfxClip) {
sfxClip.notifyAll(); // awaken anyone waiting for this Clip
}
}
Anyone had this problem before, or any ideas on a way around…?
Thanks!
Pete (Red27).