Playing an audio file multiple times
Purpose. Plays an audio file repeatedly by resetting the AudioInputStream rather than using a Clip.
java RewindingAudioPlayer audiofile
Bugs, limitations. Compressed formats cannot be handled. For a way to handle encoded as well as unencoded files, see AudioPlayer.
Source code. RewindingAudioPlayer.java