1
0
Fork 0

Use absolute values for the peak meter gain

I guess I wasn't thinking too clearly when I wrote this.
This commit is contained in:
Robbert van der Helm 2022-02-06 19:20:03 +01:00
parent df76047419
commit 02614e4a5a

View file

@ -178,7 +178,7 @@ impl Plugin for Gain {
amplitude += *sample;
}
amplitude /= num_samples as f32;
amplitude = (amplitude / num_samples as f32).abs();
let current_peak_meter = self.peak_meter.load(std::sync::atomic::Ordering::Relaxed);
let new_peak_meter = if amplitude > current_peak_meter {
amplitude