feat: overlap-window speechbrain enhance, hop 200ms / window 1s

This commit is contained in:
Hermes
2026-08-28 05:17:13 +00:00
parent 628307ff12
commit d8452c0ffe
7 changed files with 88 additions and 26 deletions
+20
View File
@@ -28,3 +28,23 @@ def test_process_preserves_length_and_int16():
out = c.process(pcm)
assert out.dtype == np.int16
assert out.shape == pcm.shape
def test_overlap_process_emits_hop_length():
c = AudioCleaner(mode="force", chunk_s=1.0, hop_s=0.2)
hop = 3200
pcm = (np.random.randn(hop) * 500).astype(np.int16)
out = c.process(pcm)
assert out.shape == (hop,)
def test_overlap_runs_model_after_enough_context():
c = AudioCleaner(mode="force", chunk_s=0.5, hop_s=0.25)
hop = 4000
for _ in range(4):
pcm = (np.sin(2 * np.pi * 440 * np.arange(hop) / 16000) * 8000).astype(
np.int16
)
out = c.process(pcm)
assert out.shape == (hop,)
assert out.dtype == np.int16