Fixes issue #717

GainNode now attenuates or boosts the signal correctly, according to the logarithmic dB scale
This commit is contained in:
Chuf 2019-03-14 21:08:08 +01:00 committed by Jordan Eldredge
parent 99b4ad5f98
commit ff1d18c044

View file

@ -187,7 +187,7 @@ export default class Media {
setVolume(volume: number) {
this._gainNode.gain.value = volume / 100;
}
// from 0 to 100
// The input value here is 0-100 which is kinda wrong, since it represents -12db to 12db.
// For now, 50 is 0db (no change).
// Equation used is: 10^((dB)/20) = x, where x (preamp.gain.value) is passed on to gainnode for boosting or attenuation.