1
我正在编写一些代码,它将在运行时自动启动midi序列的播放,并且用户可以随时按下某个键暂停。他们主要的事件处理工作就好了,但是,我发现了一个很奇怪的错误,其中有暂停序:暂停Java定序器复位速度
public void pause() {
// if the sequencer is playing, pause its playback
if (this.isPlaying) {
this.sequencer.stop();
} else { // otherwise "restart" the music
this.sequencer.start();
}
this.isPlaying = !this.isPlaying;
}
重置定序器的速度。歌曲/音序器以120000 MPQ开始播放(从我的输入加载)并重置为500000 MPQ。有谁知道为什么会发生这种情况?谢谢。
停止不会暂停。为什么你的实现中的代码只能由作者知道。 –