From bcd883e767526e7e5f4a8fae0c68853ee8ea1e00 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 5 Apr 2020 18:14:26 +0100 Subject: [PATCH] Fix weird buzzing in the software mixer Not really sure why this causes it, but apparently it does. --- src/Backends/Audio/SoftwareMixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Backends/Audio/SoftwareMixer.cpp b/src/Backends/Audio/SoftwareMixer.cpp index afae1b4b..0b3c87b3 100644 --- a/src/Backends/Audio/SoftwareMixer.cpp +++ b/src/Backends/Audio/SoftwareMixer.cpp @@ -159,7 +159,7 @@ ATTR_HOT void Mixer_MixSounds(float *stream, unsigned int frames_total) const float sample2 = (sound->samples[(size_t)sound->position + 1] - 128.0f) / 128.0f; // Perform linear interpolation - const float interpolated_sample = sample1 + ((sample2 - sample1) * fmod((float)sound->position, 1.0f)); + const float interpolated_sample = sample1 + ((sample2 - sample1) * fmod(sound->position, 1.0)); *steam_pointer++ += interpolated_sample * sound->volume_l; *steam_pointer++ += interpolated_sample * sound->volume_r;