From 5e5f62b77f34d8a9c0fdaed1fd5559057c48c077 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 27 Dec 2018 15:03:54 +0100 Subject: Improved clip prevention. --- src/soundplayer.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/soundplayer.cc') diff --git a/src/soundplayer.cc b/src/soundplayer.cc index d24eec5..319b11a 100644 --- a/src/soundplayer.cc +++ b/src/soundplayer.cc @@ -92,11 +92,7 @@ void SoundPlayer::run() goto nextitem; } - //while(std::abs(_sf[i] + item.samples[item.pos] * scale) > 1.0) - //{ - // scale *= 0.999999; - //} - scale = 1.0 / active.size(); + scale = std::min(scale, 1.0 / active.size()); _sf[i] += item.samples[item.pos] * scale; item.pos++; -- cgit v1.2.3