mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 17:21:31 +00:00
refactor(VolumeInterface): remove usage of deprecated new Buffer (#2531)
This commit is contained in:
parent
60288d0704
commit
bd9c9ce4e0
1 changed files with 1 additions and 1 deletions
|
|
@ -41,7 +41,7 @@ class VolumeInterface extends EventEmitter {
|
||||||
volume = volume || this._volume;
|
volume = volume || this._volume;
|
||||||
if (volume === 1) return buffer;
|
if (volume === 1) return buffer;
|
||||||
|
|
||||||
const out = new Buffer(buffer.length);
|
const out = Buffer.alloc(buffer.length);
|
||||||
for (let i = 0; i < buffer.length; i += 2) {
|
for (let i = 0; i < buffer.length; i += 2) {
|
||||||
if (i >= buffer.length - 1) break;
|
if (i >= buffer.length - 1) break;
|
||||||
const uint = Math.min(32767, Math.max(-32767, Math.floor(volume * buffer.readInt16LE(i))));
|
const uint = Math.min(32767, Math.max(-32767, Math.floor(volume * buffer.readInt16LE(i))));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue