From 11bc4cb7c7f7e55b362ccc1b81837cb784c50182 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Sat, 4 Apr 2020 17:51:08 +0200 Subject: [PATCH] Correct looping through samples --- ambed/cfirfilter.cpp | 2 +- ambed/cfixedgain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ambed/cfirfilter.cpp b/ambed/cfirfilter.cpp index 1b704c2..67a0fb1 100644 --- a/ambed/cfirfilter.cpp +++ b/ambed/cfirfilter.cpp @@ -45,7 +45,7 @@ CFIRFilter::~CFIRFilter() inline void CFIRFilter::ProcessSampleBlock(uint8* voice, int length) { - for(int i = 0; i < length; i++) + for(int i = 0; i < length; i += 2) { float input = (float)(short)MAKEWORD(voice[i+1], voice[i]); float output = 0.0f; diff --git a/ambed/cfixedgain.cpp b/ambed/cfixedgain.cpp index 55faebc..600df13 100644 --- a/ambed/cfixedgain.cpp +++ b/ambed/cfixedgain.cpp @@ -40,7 +40,7 @@ CFixedGain::CFixedGain(float gaindB) inline void CFixedGain::ProcessSampleBlock(uint8* voice, int length) { - for(int i = 0; i < length; i++) + for(int i = 0; i < length; i += 2) { float input = (float)(short)MAKEWORD(voice[i+1], voice[i]); //apply gain