I've made a game of breakout and now I'm adding the sounds. I'm getting the following error at runtime:
Exception in thread "Thread-18" java.lang.IllegalStateException: Clip is already open with format PCM_SIGNED 44100.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian and frame lengh of 23079
This error happens each time the ball hits a brick and the brickhit.wav sound plays.
The code I've got so far in my sound class is:
Any ideas how to prevent this error? Cheers
ps For some reason the same thing doesn't occur when the ball hits the paddle...ONLY when it hits a brick