Music Loop in Java
问题 Good day! I am doing a game and I want it to have a background sound. I created a class for it and I call it on my main. My code is as follows: import sun.audio.*; import java.io.*; public class Sound { public void music() { AudioStream backgroundMusic; AudioData musicData; AudioPlayer musicPlayer = AudioPlayer.player; ContinuousAudioDataStream loop = null; try { backgroundMusic = new AudioStream(new FileInputStream("chickendance.wav")); musicData = backgroundMusic.getData(); loop = new