X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mixer.cpp;h=03cf99d3435969891ccc1961d7f71c1b479861a5;hb=12f9082b06c037b76dc3a653643bdaeaea89f2d2;hp=d90359265b9cec2b722cbc5b141d9ffb1f943e8c;hpb=0f079f3c88e85d49208836642a579b4fd520fb76;p=nageru diff --git a/mixer.cpp b/mixer.cpp index d903592..03cf99d 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -149,6 +149,8 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards) r128.init(2, OUTPUT_FREQUENCY); r128.integr_start(); + + locut.init(FILTER_HPF, 2); } Mixer::~Mixer() @@ -538,6 +540,11 @@ void Mixer::process_audio_one_frame() } } + // Cut away everything under 150 Hz; we don't need it for voice, + // and it will reduce headroom and confuse the compressor. + // (In particular, any hums at 50 or 60 Hz should be dampened.) + locut.render(samples_out.data(), samples_out.size() / 2, 150.0 * 2.0 * M_PI / OUTPUT_FREQUENCY, 0.5f); + // Apply a level compressor to get the general level right. // Basically, if it's over about -40 dBFS, we squeeze it down to that level // (or more precisely, near it, since we don't use infinite ratio),