From dbd4ce31205b56adb995981b5c5e7faeed3e6a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=98=8E=E6=99=BA?= Date: Mon, 17 Sep 2018 18:25:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BD=AC=E6=8D=A2=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=9C=89=E5=99=AA=E5=A3=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- speech-to-text/webaudio-l16-stream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speech-to-text/webaudio-l16-stream.js b/speech-to-text/webaudio-l16-stream.js index 41a67f28..d283d190 100644 --- a/speech-to-text/webaudio-l16-stream.js +++ b/speech-to-text/webaudio-l16-stream.js @@ -114,7 +114,7 @@ WebAudioL16Stream.prototype.downsample = function downsample(bufferNewSamples) { var nOutputSamples = Math.floor((buffer.length - filter.length) / samplingRateRatio) + 1; var outputBuffer = new Float32Array(nOutputSamples); - for (i = 0; i + filter.length - 1 < buffer.length; i++) { + for (i = 0; i < outputBuffer.length; i++) { offset = Math.round(samplingRateRatio * i); var sample = 0; for (var j = 0; j < filter.length; ++j) {