Scale the timeline waveform by the layer's Audio Levels (#974)

This commit is contained in:
MarekSpodBiedry
2026-10-12 08:39:44 +02:00
parent 67434e9038
commit 25be439a0b
2 changed files with 33 additions and 3 deletions
+2 -1
View File
@@ -74,7 +74,8 @@ pub fn audible(project: &Project, l: &Layer) -> bool {
})
}
fn db_to_gain(db: f64) -> f32 {
/// Linear gain of an Audio Levels value in dB; -96 dB and below is silence.
pub fn db_to_gain(db: f64) -> f32 {
if db <= -96.0 { 0.0 } else { 10f64.powf(db / 20.0) as f32 }
}