feat: overlap-window speechbrain enhance, hop 200ms / window 1s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user