From 12849b354eaba65efdaad7277863f6b0f036bb38 Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 8 Oct 2011 17:57:23 +0000 Subject: [PATCH] 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 --- snd_mix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.39.2