If I have a java.applet.AudioClip object I can call play on it to play it once. But if I call play multiple times then the clip will simply keep restarting. The only way to get around that seems to be to load multiple instances of the same sound file. That seems wasteful of memory. In a game, if I have 20 explosions occurring then I'd have to load 20 instances of the sound file.
I took a quick look at javax.sound to see if using it instead of AudioClip would help here. I don't see anything that indicates that it supports playing the same clip multiple times simultaneously.
Is it possible to do without loading the same sound file multiple times either with the simple java.applet.AudioClip or with the javax.sound stuff?