From a5708c0450a5f0f75a8bec7bf76a857069922c65 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 7 Mar 2013 11:24:59 -0800 Subject: [PATCH] take proper max/min values for samples --- mixer/src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mixer/src/main.cpp b/mixer/src/main.cpp index df45511618..9631df8af0 100644 --- a/mixer/src/main.cpp +++ b/mixer/src/main.cpp @@ -46,8 +46,8 @@ AgentList agentList(MIXER_LISTEN_PORT); void plateauAdditionOfSamples(int16_t &mixSample, int16_t sampleToAdd) { long sumSample = sampleToAdd + mixSample; - long normalizedSample = std::max(MAX_SAMPLE_VALUE, sumSample); - normalizedSample = std::min(MIN_SAMPLE_VALUE, sumSample); + long normalizedSample = std::min(MAX_SAMPLE_VALUE, sumSample); + normalizedSample = std::max(MIN_SAMPLE_VALUE, sumSample); mixSample = normalizedSample; }