Audio: speech leveler (auto gain to -20 dBFS speech, -6..+20 dB, gated) between gate and compressor; honest mic meter (drop the +10 dB display boost and x1.2). Creator upload measured -28.5 LUFS; same audio through the new chain: -17.9 LUFS / -0.7 dBFS peak (Unit: audio loudness)

This commit is contained in:
2026-10-09 13:27:53 -07:00
parent 8303b1cf7f
commit b140024ebf
7 changed files with 169 additions and 26 deletions
+9 -11
View File
@@ -331,22 +331,20 @@ public class AudioLevelMeterTests
Assert.Equal(0f, AudioLevelMeter.ToDisplay(0f));
Assert.Equal(0f, AudioLevelMeter.ToDisplay(0.001f), 2);
// -60 dBFS floor → 0, 0 dBFS → 1, and +10 dB amplification: a decade
// (~-20 dB) is 2/3 up the bar.
// -60 dBFS floor → 0, 0 dBFS → 1, honest in between (no hidden boost).
Assert.Equal(1f, AudioLevelMeter.ToDisplay(1f), 3);
Assert.InRange(AudioLevelMeter.ToDisplay(0.0316f), 0.66f, 0.67f);
Assert.InRange(AudioLevelMeter.ToDisplay(0.1f), 0.83f, 0.84f);
Assert.InRange(AudioLevelMeter.ToDisplay(0.01f), 0.49f, 0.51f);
Assert.InRange(AudioLevelMeter.ToDisplay(0.0316f), 0.49f, 0.51f);
Assert.InRange(AudioLevelMeter.ToDisplay(0.1f), 0.66f, 0.67f);
Assert.InRange(AudioLevelMeter.ToDisplay(0.01f), 0.33f, 0.34f);
}
[Fact]
public void ToDisplay_Pushes_Speech_Peaks_Into_Red_At_Maxed_Volume()
public void ToDisplay_Puts_Leveled_Speech_At_The_Green_Yellow_Edge_And_Peaks_In_Red()
{
// ~0.2 linear RMS (-14 dBFS) is a loud speech peak; at maxed volume it
// must land in the red zone (0.8+) and normal speech (~0.05, -26 dBFS)
// in the yellow — the meter uses the whole bar proportionately.
Assert.InRange(AudioLevelMeter.ToDisplay(0.2f), 0.92f, 0.95f);
Assert.InRange(AudioLevelMeter.ToDisplay(0.05f), 0.72f, 0.75f);
// The speech leveler targets -20 dBFS: that sits at 2/3 of the bar (the yellow
// zone starts at 60%); a hot -6 dBFS peak reaches the red (80%+).
Assert.InRange(AudioLevelMeter.ToDisplay(SpeechLeveler.TargetRms), 0.66f, 0.67f);
Assert.InRange(AudioLevelMeter.ToDisplay(0.5f), 0.89f, 0.91f);
}
[Fact]