From b62b4e427af4fe41ee4fe6b36fce2f82b62a6704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sun, 4 Oct 2020 00:40:03 +0200 Subject: [PATCH] Fix sound mixing --- main_sdl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main_sdl.c b/main_sdl.c index 6e4d576..f14dbac 100644 --- a/main_sdl.c +++ b/main_sdl.c @@ -342,8 +342,8 @@ void SFG_playSound(uint8_t soundIndex, uint8_t volume) for (int i = 0; i < SFG_SFX_SAMPLE_COUNT; ++i) { - audioBuff[pos] = - (128 - SFG_GET_SFX_SAMPLE(soundIndex,i)) * volumeScale; + audioBuff[pos] = mixSamples(audioBuff[pos], + (128 - SFG_GET_SFX_SAMPLE(soundIndex,i)) * volumeScale); pos = (pos < SFG_SFX_SAMPLE_COUNT - 1) ? (pos + 1) : 0; }