I think declaring clip as an instance variable is going to cause a problem when used with threads like that. It's possible for a sound clip to get opened and never stopped.
Think about this, you have two sound clips, A and B. You call playSound and pass A's info in as a parameter. A thread starts up, assigns A to the clip instance variable and starts playing A's sound. Then you call playSound again with B's info. A new thread starts up, assigns B to the clip instance variable (replacing A's reference, without ever calling stop on A's Clip) and starts playing B's sound.
If you call your stop method, B's Clip gets stopped, because it's referenced through the clip instance variable - but A's Clip never got stopped. I'm guessing that the next time you pass A's info into AudioSystem to create a Clip for it, it still has the open Clip that never got stopped and just returns that. Then you get an error because you're trying to re-open a Clip that hasn't been stopped.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
What? What, what, what? What what tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth