summaryrefslogtreecommitdiffstats
path: root/src/audio_core/stream.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-01-22 11:25:59 +0100
committerGitHub <noreply@github.com>2022-01-22 11:25:59 +0100
commit5b57ee66ce011bf6e73739229bf7354b02f33c1a (patch)
tree4b1993c415db0c44c597e6418747c51e50f03526 /src/audio_core/stream.cpp
parentMerge pull request #7735 from german77/udp_battery (diff)
parentaudio/stream: Adjust volume scale factor (diff)
downloadyuzu-5b57ee66ce011bf6e73739229bf7354b02f33c1a.tar
yuzu-5b57ee66ce011bf6e73739229bf7354b02f33c1a.tar.gz
yuzu-5b57ee66ce011bf6e73739229bf7354b02f33c1a.tar.bz2
yuzu-5b57ee66ce011bf6e73739229bf7354b02f33c1a.tar.lz
yuzu-5b57ee66ce011bf6e73739229bf7354b02f33c1a.tar.xz
yuzu-5b57ee66ce011bf6e73739229bf7354b02f33c1a.tar.zst
yuzu-5b57ee66ce011bf6e73739229bf7354b02f33c1a.zip
Diffstat (limited to '')
-rw-r--r--src/audio_core/stream.cpp4
1 files 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<s16>& 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<s16>(sample * volume_scale_factor);
}