From 3b77fb6a74f7a58033168202a772f3630fb9a30f Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 9 Nov 2015 23:00:42 +0100 Subject: [PATCH] Tweak the limiter by ear; increase the headroom so it does not trigger as often (we still have 10 dB to go on), and also increase the release time which makes it a lot less ugly. Tested on both music and conference audio. --- mixer.cpp | 2 +- mixer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mixer.cpp b/mixer.cpp index 861ea94..8ccd7fa 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -585,7 +585,7 @@ void Mixer::process_audio_one_frame() float threshold = pow(10.0f, limiter_threshold_dbfs / 20.0f); float ratio = 30.0f; float attack_time = 0.0f; // Instant. - float release_time = 0.005f; + float release_time = 0.020f; float makeup_gain = 1.0f; // 0 dB. limiter.process(samples_out.data(), samples_out.size() / 2, threshold, ratio, attack_time, release_time, makeup_gain); // limiter_att = limiter.get_attenuation(); diff --git a/mixer.h b/mixer.h index 64a74e2..252f961 100644 --- a/mixer.h +++ b/mixer.h @@ -257,7 +257,7 @@ private: static constexpr float ref_level_dbfs = -14.0f; StereoCompressor limiter; - std::atomic limiter_threshold_dbfs{ref_level_dbfs + 0.0f}; // 0 dB. + std::atomic limiter_threshold_dbfs{ref_level_dbfs + 4.0f}; // 4 dB. std::atomic limiter_enabled{true}; StereoCompressor compressor; std::atomic compressor_threshold_dbfs{ref_level_dbfs - 12.0f}; // -12 dB. -- 2.39.2