+ Resampler peak_resampler;
+ std::atomic<float> peak{0.0f};
+
+ StereoFilter locut; // Default cutoff 150 Hz, 24 dB/oct.
+ std::atomic<float> locut_cutoff_hz;
+
+ // First compressor; takes us up to about -12 dBFS.
+ StereoCompressor level_compressor;
+ float last_gain_staging_db = 0.0f;
+
+ static constexpr float ref_level_dbfs = -14.0f;
+
+ StereoCompressor limiter;
+ std::atomic<float> limiter_threshold_dbfs{ref_level_dbfs + 4.0f}; // 4 dB.
+ std::atomic<bool> limiter_enabled{true};
+ StereoCompressor compressor;
+ std::atomic<float> compressor_threshold_dbfs{ref_level_dbfs - 12.0f}; // -12 dB.
+ std::atomic<bool> compressor_enabled{true};
+
+ std::unique_ptr<ALSAOutput> alsa;
+
+ struct AudioTask {
+ int64_t pts_int;
+ int num_samples;
+ };
+ std::mutex audio_mutex;
+ std::condition_variable audio_task_queue_changed;
+ std::queue<AudioTask> audio_task_queue; // Under audio_mutex.