Rescaled volume to -50..0db, should be final now.

This commit is contained in:
Marat Fayzullin 2024-05-21 22:36:21 -04:00
parent 297fa9ec73
commit 702a52b196
1 changed files with 2 additions and 2 deletions

View File

@ -76,8 +76,8 @@ UI.setVolume = function(x) {
LS.save('volume', x);
$('#openwebrx-panel-volume').val(x)
if (audioEngine) {
// Map 0-150 to -40..0db gain
gain = x > 0? Math.pow(10, ((x / 3.75) - 40) / 20) : 0;
// Map 0-150 to -50..0db gain
gain = x > 0? Math.min(1.0, Math.pow(10, ((x / 3.0) - 50) / 20)) : 0;
audioEngine.setVolume(gain);
}
}