import numpy as np import pytest from mic_clipper.vad import FRAME_SAMPLES, SileroVad def test_bundled_silero_vad_accepts_512_samples_and_returns_probability(): vad = SileroVad() probability = vad.probability(np.zeros(FRAME_SAMPLES, dtype=np.float32)) assert 0.0 <= probability <= 1.0 def test_bundled_silero_vad_rejects_non_512_sample_frames(): vad = SileroVad() with pytest.raises(ValueError, match="512"): vad.probability(np.zeros(FRAME_SAMPLES - 1, dtype=np.float32))