summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2021-04-04 19:13:08 +0100
committerCharles Pigott <charlespigott@googlemail.com>2021-04-06 19:31:14 +0100
commit920bf703cda28e2c864531f5bc5468cff1f0ce73 (patch)
tree3d0d34bc9103dd6afd69208742e4efac1c32a3ef
parent42fbdda9ab12a06a5fbe4817cb93c227b828e042 (diff)
downloadopenttd-920bf703cda28e2c864531f5bc5468cff1f0ce73.tar.xz
Fix: Allow full sample range for 16-bit audio.
Clamping each sample value to half the available range could cause unnecessary premature clipping with lots of sounds playing. This change does not affect the actual volume level.
-rw-r--r--src/mixer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mixer.cpp b/src/mixer.cpp
index 0c9d9b151..d892a573c 100644
--- a/src/mixer.cpp
+++ b/src/mixer.cpp
@@ -46,7 +46,7 @@ static MxStreamCallback _music_stream = nullptr;
* stops overflowing when too many sounds are played at the same time, which
* causes an even worse sound quality.
*/
-static const int MAX_VOLUME = 128 * 128;
+static const int MAX_VOLUME = 32767;
/**
* Perform the rate conversion between the input and output.