我正在尝试循环播放音频文件,但是当我尝试了其他各种可用方法时,我的音乐无法播放。
我的基本代码是:
import java.io.*;
import sun.audio.*;
public class PlayMusic {
public void playSound() {
try {
AudioPlayer p = AudioPlayer.player;
AudioStream as = new AudioStream(new FileInputStream("02 River Flows In You.wav"));
p.start(as);
} catch (IOException IOE) {
}
}