From 7fabac795e653876ea4f61e1eb1e4492b02ed424 Mon Sep 17 00:00:00 2001 From: Martmists Date: Wed, 28 Jul 2021 18:22:50 +0200 Subject: [PATCH] small fixes --- src/utils/DynamicBass.cpp | 12 ++++++------ src/utils/DynamicBass.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils/DynamicBass.cpp b/src/utils/DynamicBass.cpp index 9b8355e..7c5ea7a 100644 --- a/src/utils/DynamicBass.cpp +++ b/src/utils/DynamicBass.cpp @@ -14,25 +14,25 @@ DynamicBass::DynamicBass() { this->lowFreqX = 120; this->highFreqX = 80; this->lowFreqY = 40; - this->highFreqY = this->samplerate / 4.f; + this->highFreqY = (float)this->samplerate / 4.f; this->filterX.SetPassFilter(this->lowFreqX, this->highFreqX); this->filterY.SetPassFilter(this->lowFreqY, this->highFreqY); - this->lowPass.SetLowPassParameter(55.f, this->samplerate, this->qPeak / 666.f + 0.5f) + this->lowPass.SetLowPassParameter(55.f, this->samplerate, this->qPeak / 666.f + 0.5f); } void DynamicBass::Reset() { this->filterX.Reset(); this->filterY.Reset(); - this->lowPass.SetLowPassParameter(55.f, this->samplerate, this->qPeak / 666.f + 0.5f) + this->lowPass.SetLowPassParameter(55.f, this->samplerate, this->qPeak / 666.f + 0.5f); } void DynamicBass::FilterSamples(float *samples, uint32_t size) { if (this->lowFreqX <= 120) { for (int i = 0; i < size; i++) { - int left = samples[2*i]; - int right = samples[2*i+1]; - int avg = this->lowPass.ProcessSample(left + right); + float left = samples[2*i]; + float right = samples[2*i+1]; + float avg = this->lowPass.ProcessSample(left + right); samples[2*i] = left + avg; samples[2*i+1] = right + avg; } diff --git a/src/utils/DynamicBass.h b/src/utils/DynamicBass.h index f4d5a91..7b7f669 100644 --- a/src/utils/DynamicBass.h +++ b/src/utils/DynamicBass.h @@ -23,7 +23,7 @@ public: uint32_t lowFreqX, highFreqX; uint32_t lowFreqY, highFreqY; uint32_t samplerate; - uint32_t qPeak; + float qPeak; float bassGain; float sideGainX, sideGainY;