diff --git a/wavesurfer/js/pcm-player.js b/wavesurfer/js/pcm-player.js index 069c829..f827465 100644 --- a/wavesurfer/js/pcm-player.js +++ b/wavesurfer/js/pcm-player.js @@ -12,10 +12,10 @@ this.pause() this.button.innerHTML = '播放 ' } else { - this.continue() + this.play() this.button.innerHTML = '暂停 ' } - }) + }.bind(this)) this.option = Object.assign({}, {channels: 1, sampleRate: 16000, flushTime: 100}, option) // 每隔 flushTime 毫秒调用一次 flush 函数 @@ -76,7 +76,7 @@ this.samples = new Int16Array() } - async continue() { + async play() { await this.audioCtx.resume() }