Add a function to set the volume to a decibel value

This commit is contained in:
meew0
2016-04-02 11:09:51 +02:00
parent 910b5a7ae6
commit 3a2c449197

View File

@@ -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;
}