mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Removed usage of (deprecated) new Buffer (#2531)
This commit is contained in:
@@ -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))));
|
||||||
|
|||||||
Reference in New Issue
Block a user