From 850896a52bdc2ff8a555d6e702eb5638c30a084e Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 15 Jan 2022 20:28:17 -0600 Subject: audio/stream: Adjust volume scale factor --- src/audio_core/stream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index 5a30f55a7..0abc989b2 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp @@ -79,8 +79,8 @@ static void VolumeAdjustSamples(std::vector& samples, float game_volume) { return; } - // Implementation of a volume slider with a dynamic range of 60 dB - const float volume_scale_factor = volume == 0 ? 0 : std::exp(6.90775f * volume) * 0.001f; + // Perceived volume is not the same as the volume level + const float volume_scale_factor = (0.85f * ((volume * volume) - volume)) + volume; for (auto& sample : samples) { sample = static_cast(sample * volume_scale_factor); } -- cgit v1.2.3