Skip to content

πŸŽ› πŸ”Š A Python library for audio.

test(BrickwallLimiter): add silence test

Christopher Jacoby2e104aac4d2b
diff --git a/tests/test_brickwall_limiter.py b/tests/test_brickwall_limiter.py
index 8c60963..4471094 100644
--- a/tests/test_brickwall_limiter.py
+++ b/tests/test_brickwall_limiter.py
@@ -47,6 +47,14 @@ def test_passthrough_below_ceiling():
np.testing.assert_allclose(output, quiet_sine, atol=1e-6)
+def test_silence():
+ """Silence in, silence out β€” no gain, no noise, no artifacts."""
+ signal = np.zeros(44100, dtype=np.float32)
+ plugin = BrickwallLimiter(ceiling_db=-1.0)
+ output = plugin.process(signal, 44100)
+ np.testing.assert_array_equal(output, signal)
+
+
def test_no_makeup_gain():
"""Unlike the built-in Limiter, BrickwallLimiter must NOT boost quiet signals."""
quiet_sine = _sine_f32(44100, 440.0, num_seconds=0.5, num_channels=1) * np.float32(0.1)