mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 08:41:29 +00:00
Removed usage of (deprecated) new Buffer (#2531)
This commit is contained in:
parent
21cc2952eb
commit
42ce4f8bc0
1 changed files with 1 additions and 1 deletions
|
|
@ -49,7 +49,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