update volume calculator
This commit is contained in:
parent
58c3589295
commit
0fc48b731c
2 changed files with 3 additions and 2 deletions
|
@ -176,6 +176,7 @@ class Queue<T = unknown> {
|
|||
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);
|
||||
|
|
|
@ -142,14 +142,14 @@ class BasicStreamDispatcher extends EventEmitter<VoiceEvents> {
|
|||
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() {
|
||||
|
|
Loading…
Reference in a new issue