mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Add a function to set the volume to a decibel value
This commit is contained in:
@@ -23,6 +23,11 @@ class Volume extends Transform {
|
||||
this.volume = Math.pow(value, 1.660964);
|
||||
}
|
||||
|
||||
// Set the volume to a value specified as decibels.
|
||||
setVolumeDecibels(db) {
|
||||
this.volume = Math.pow(10, db / 20);
|
||||
}
|
||||
|
||||
get multiplier() {
|
||||
return this.volume;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user