Skip to content

Commit

Permalink
Merge pull request #90 from mingzhi22/master
Browse files Browse the repository at this point in the history
fix: 降采样后的文件有噪声
  • Loading branch information
dpopp07 authored Mar 19, 2019
2 parents 7f29910 + dbd4ce3 commit 3d6c69d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion speech-to-text/webaudio-l16-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3d6c69d

Please sign in to comment.