Skip to content

Commit d03cab3

Browse files
committed
using Buffer.from instead of new Buffer()
1 parent ed4d2c8 commit d03cab3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

speech-to-text/webaudio-l16-stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ WebAudioL16Stream.prototype.floatTo16BitPCM = function(input) {
147147
var multiplier = input[i] < 0 ? 0x8000 : 0x7fff; // 16-bit signed range is -32768 to 32767
148148
output.setInt16(i * 2, input[i] * multiplier | 0, true); // index, value, little edian
149149
}
150-
return new Buffer(output.buffer);
150+
return Buffer.from(output.buffer);
151151
};
152152

153153
/**

0 commit comments

Comments
 (0)