From d78db36ecc7c44424fed5ee7020e3c32d02e047e Mon Sep 17 00:00:00 2001 From: Phil Schatzmann Date: Mon, 23 Oct 2023 00:24:56 +0200 Subject: [PATCH] Compressor cleanup --- src/AudioEffects/AudioEffect.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AudioEffects/AudioEffect.h b/src/AudioEffects/AudioEffect.h index e953f36eb4..304a8e80c9 100644 --- a/src/AudioEffects/AudioEffect.h +++ b/src/AudioEffects/AudioEffect.h @@ -469,7 +469,7 @@ class Compressor : public AudioEffect { Compressor(const Compressor ©) = default; /// Default Constructor - Compressor(uint32_t sampleRate = 44100, int32_t attackMs=30, int32_t releaseMs=20, int32_t holdMs=10, uint8_t thresholdPercent=10, float compressionRatio=0.5){ + Compressor(uint32_t sampleRate = 44100, uint16_t attackMs=30, uint16_t releaseMs=20, uint16_t holdMs=10, uint8_t thresholdPercent=10, float compressionRatio=0.5){ //assuming 1 sample = 1/96kHz = ~10us //Attack -> 30 ms -> 3000 //Release -> 20 ms -> 2000 @@ -489,19 +489,19 @@ class Compressor : public AudioEffect { } /// Defines the attack duration in ms - void setAttack(int32_t attackMs){ + void setAttack(uint16_t attackMs){ attack_count = sample_rate * attackMs / 1000; recalculate(); } /// Defines the release duration in ms - void setRelease(int32_t releaseMs){ + void setRelease(uint16_t releaseMs){ release_count = sample_rate * releaseMs / 1000; recalculate(); } /// Defines the hold duration in ms - void setHold(int32_t holdMs){ + void setHold(uint16_t holdMs){ hold_count = sample_rate * holdMs / 1000; recalculate(); }