diff --git a/lib/Voice/VolumeTransformer.js b/lib/Voice/VolumeTransformer.js index ad01b6614..b0b1f5c48 100644 --- a/lib/Voice/VolumeTransformer.js +++ b/lib/Voice/VolumeTransformer.js @@ -50,7 +50,7 @@ var Volume = (function (_Transform) { // Check whether the index is actually in range - sometimes it's possible // that it skips ahead too far before the end condition of the for can // kick in. - if (i >= buffer.length) { + if (i >= buffer.length - 1) { break; } diff --git a/src/Voice/VolumeTransformer.js b/src/Voice/VolumeTransformer.js index 17cfb8136..6fc41d7f9 100644 --- a/src/Voice/VolumeTransformer.js +++ b/src/Voice/VolumeTransformer.js @@ -47,7 +47,7 @@ class Volume extends Transform { // Check whether the index is actually in range - sometimes it's possible // that it skips ahead too far before the end condition of the for can // kick in. - if (i >= buffer.length) { + if (i >= buffer.length - 1) { break; }