normalize audio

This commit is contained in:
2026-05-23 20:38:35 -05:00
parent 3debd66ddd
commit 4bba36ce6a

View File

@@ -67,6 +67,9 @@ def main():
chunk = signal[:, start_sample:end_sample]
# normalize
chunk /= chunk.abs().max()
# SpeechBrain expects [batch, time]
emb = classifier.encode_batch(chunk)
emb = emb.squeeze().detach().cpu().numpy()