- StereoCompressor compressor;
- std::atomic<float> compressor_threshold_dbfs{ref_level_dbfs - 12.0f}; // -12 dB.
- std::atomic<bool> compressor_enabled{true};
+ std::unique_ptr<StereoCompressor> compressor[MAX_BUSES];
+ std::atomic<float> compressor_threshold_dbfs[MAX_BUSES];
+ std::atomic<bool> compressor_enabled[MAX_BUSES];
+
+ // Note: The values here are not in dB.
+ struct PeakHistory {
+ float current_level = 0.0f; // Peak of the last frame.
+ float historic_peak = 0.0f; // Highest peak since last reset; no falloff.
+ float current_peak = 0.0f; // Current peak of the peak meter.
+ float last_peak = 0.0f;
+ float age_seconds = 0.0f; // Time since "last_peak" was set.
+ };
+ PeakHistory peak_history[MAX_BUSES][2]; // Separate for each channel. Under audio_mutex.