From 920bf703cda28e2c864531f5bc5468cff1f0ce73 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 4 Apr 2021 19:13:08 +0100 Subject: 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. --- src/mixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- cgit v1.2.3-54-g00ecf