From: divverent Date: Sat, 8 Oct 2011 17:57:23 +0000 (+0000) Subject: sound mixing: PROPERLY detect silent sounds. Old code would cut off sounds at -15dB... X-Git-Tag: xonotic-v0.6.0~163^2~161 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=12849b354eaba65efdaad7277863f6b0f036bb38;p=xonotic%2Fdarkplaces.git sound mixing: PROPERLY detect silent sounds. Old code would cut off sounds at -15dB already. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11393 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_mix.c b/snd_mix.c index 67898912..eab51a64 100644 --- a/snd_mix.c +++ b/snd_mix.c @@ -249,7 +249,7 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) sum = 0; for (i = 0;i < SND_LISTENERS;i++) sum += vol[i]*vol[i]; - silent = sum < 0.001f; + silent = sum < (1.0f / (65536.0f * 65536.0f)); // so silent it has zero effect // when doing prologic mixing, some channels invert one side if (ch->prologic_invert == -1)