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
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""RTF bench for hop/window speechbrain enhance."""
import time
import numpy as np
from audio_cleanup import AudioCleaner
c = AudioCleaner(mode="force", chunk_s=1.0, hop_s=0.2)
hop = 3200
pcm = (np.random.randn(hop) * 800).astype(np.int16)
for _ in range(8):
c.process(pcm)
n = 50
t0 = time.perf_counter()
for _ in range(n):
c.process(pcm)
dt = time.perf_counter() - t0
audio_s = n * 0.2
rtf = dt / audio_s
print(f"hops={n} wall={dt:.3f}s audio={audio_s:.1f}s rtf={rtf:.3f}")
if rtf > 0.8:
raise SystemExit("RTF too high for 20-way realtime")