shithub: cstory

Download patch

ref: bcd883e767526e7e5f4a8fae0c68853ee8ea1e00
parent: 0aa65f7cd30862aedb3044bbf2b8b0caf7e74023
author: Clownacy <[email protected]>
date: Sun Apr 5 14:14:26 EDT 2020

Fix weird buzzing in the software mixer

Not really sure why this causes it, but apparently it does.

--- a/src/Backends/Audio/SoftwareMixer.cpp
+++ b/src/Backends/Audio/SoftwareMixer.cpp
@@ -159,7 +159,7 @@
 				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;