我编写了这段代码,循环播放音频一次,然后文件继续播放
public void playNextSecond(long startFrame) {
//Get the number of frames for one second
float sampleRate = audioStream.getFormat().getSampleRate();
//Set the current playback time to the start of the loop section
clip.setFramePosition((int)startFrame);
//Set up the looping segment
clip.setLoopPoints((int)startFrame, (int)(startFrame + sampleRate));
//Loop one time
clip.loop(1);
}
我想在循环完成后停止播放。反正有没有这样做?或者,无论如何都要玩到特定的帧?