From 0fc48b731c50aaa1078fdb186e1b05a083becb0e Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Mon, 14 Jun 2021 10:31:29 +0545 Subject: [PATCH] update volume calculator --- src/Structures/Queue.ts | 1 + src/VoiceInterface/BasicStreamDispatcher.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Structures/Queue.ts b/src/Structures/Queue.ts index 36de580..bb34ff4 100644 --- a/src/Structures/Queue.ts +++ b/src/Structures/Queue.ts @@ -176,6 +176,7 @@ class Queue { const dispatcher = await this.connection.playStream(resource); dispatcher.setVolume(this.options.initialVolume); + // need to use these events here dispatcher.once("start", () => { this.playing = true; if (!options.filtersUpdate) this.player.emit("trackStart", this, this.current); diff --git a/src/VoiceInterface/BasicStreamDispatcher.ts b/src/VoiceInterface/BasicStreamDispatcher.ts index 7579ada..0d4e3aa 100644 --- a/src/VoiceInterface/BasicStreamDispatcher.ts +++ b/src/VoiceInterface/BasicStreamDispatcher.ts @@ -142,14 +142,14 @@ class BasicStreamDispatcher extends EventEmitter { if (!this.audioResource || isNaN(value) || value < 0 || value > Infinity) return false; // ye boi logarithmic ✌ - this.audioResource.volume.setVolumeLogarithmic(value / 200); + this.audioResource.volume.setVolumeLogarithmic(value / 100); return true; } get volume() { if (!this.audioResource || !this.audioResource.volume) return 100; const currentVol = this.audioResource.volume.volume; - return Math.round(Math.pow(currentVol, 1 / 1.660964) * 200); + return Math.round(Math.pow(currentVol, 1 / 1.660964) * 100); } get streamTime() {