import numpy as np import pytest import stt_core as core from conftest import SR, EnergyProb, make_wav, silence, tone # --- Audio-Hilfen ------------------------------------------------------------- def test_pcm16_to_float_mono_and_channel_selection(): stereo = np.array([[1000, -2000], [3000, -4000]], dtype=" 0.9 * SR assert not seg.in_speech and seg.flush() == [] def test_silero_prob_streaming_on_silence_and_noise(): prob = core.SileroProb() out = prob(np.zeros(core.VAD_WINDOW * 10, np.float32)) assert out.shape == (10,) and float(out.max()) < 0.2