Originally Posted by
KevinWorkman
After googling "Java AudioPlayer loop", I found this API:
sun.audio: public class: AudioPlayer
Which contains the following, at the very top of the page:
To play a continuous sound you first have to create an AudioData instance and use it to construct a ContinuousAudioDataStream. For example:
AudioData data = new AudioStream(url.openStream()).getData();
ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data);
AudioPlayer.player.start(audiostream);
My code in the OP had ContinuousAudioDataStream and I wanted it to play from the jar. But never mind I think this thread is solved because I came up with something similar but it reads the files off the current working directory with InputStream. Thanks though.