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:
parent
df76047419
commit
02614e4a5a
|
@ -178,7 +178,7 @@ impl Plugin for Gain {
|
||||||
amplitude += *sample;
|
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 current_peak_meter = self.peak_meter.load(std::sync::atomic::Ordering::Relaxed);
|
||||||
let new_peak_meter = if amplitude > current_peak_meter {
|
let new_peak_meter = if amplitude > current_peak_meter {
|
||||||
amplitude
|
amplitude
|
||||||
|
|
Loading…
Reference in a new issue