I'm developing a game and want to add some nice little music to it. I'm using the javax.sound.sampled package to do this. I have simple WAV player class like so:
Which I can use in a simple thread such as this one:
When using the MenuSong class on a Windows platform it works fine, run() starts the music and cancel() stops it. However, on Unix platforms such as CentOS or Mac OS the program "blocks" on s.stop(); - by "block" I mean the execution of the code seems paused at that point and everything there after simply isn't executed.