getting sound status?
this method works fine, the sound play, but i don't know is the sound still playing or not
AudioClip clip = Applet.newAudioClip(url);
clip.play();
i see AudioClip only have 3 methods, loop(), play(), stop()
is there other method to play sound that very simple like this one?
javax.sound.XXX is too complicated,
i only need playing sound, and get it status (still playing or not)
thank you
[452 byte] By [
javaweird] at [2007-9-30 4:49:43]

okay i take back what i said, using javax.sound is pretty simple
but looks like there's some thread that still active when using sound provide by javax.sound.sampled package, preventing jvm to exit
does anyone know this issue? and know how to exit without using System.exit(0)?
try {
AudioInputStream ain = AudioSystem.getAudioInputStream(new URL("file:///d:/test.wav"));
DataLine.Info info = new DataLine.Info(Clip.class, ain.getFormat());
Clip clip = (Clip) AudioSystem.getLine(info);
clip.open(ain);
clip.start();
} catch (Exception e) { System.err.println(e); }
> nope, i've tried to close all connection but no> luckIIRC, 1.3 and 1.4 had a bug which prevented the JVM from exiting while JavaSound was in use. If you try your code on 1.5 beta, it should be fixed.
yup i look at this code: http://www.jsresources.org/examples/ClipPlayer.java.html
and tell the javax.sound bug in jdk1.3/1.4
then how to fix this problem on 1.3/1.4?
> from exiting while JavaSound was in use
but i've close all, and not use the javasound anymore when quitting my game?
> yup i look at this code:
> http://www.jsresources.org/examples/ClipPlayer.java.htm
>
> and tell the javax.sound bug in jdk1.3/1.4
> then how to fix this problem on 1.3/1.4?
The old-fashioned way of course. Add this one line of code to your shutdown routines:
System.exit(0);
That should do the trick. ;-)
(I do realize that you're not supposed to use System.exit() if you can help it, but unfortunately bugs like this keep requiring programmers to exit their programs in an unnatural fashion.)