From ff1d18c044506c9cbd77d752301a6e061ac2c8b3 Mon Sep 17 00:00:00 2001 From: Chuf <42591821+gapeman@users.noreply.github.com> Date: Thu, 14 Mar 2019 21:08:08 +0100 Subject: [PATCH] Fixes issue #717 GainNode now attenuates or boosts the signal correctly, according to the logarithmic dB scale --- js/media/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/media/index.ts b/js/media/index.ts index cbc54819..e4cac267 100644 --- a/js/media/index.ts +++ b/js/media/index.ts @@ -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.