from pyannote_diarization_3_1_mlx._window import sliding_windows import numpy as np def test_sliding_windows_full_coverage(): sr = 16000 audio = np.zeros(int(25 * sr), dtype=np.float32) windows = list(sliding_windows(audio, sr=sr, duration_s=10.0, hop_s=1.0)) # Expect (25-10)/1 + 1 = 16 windows, all 10 s long assert len(windows) == 16 for start, end, slice_ in windows: assert end - start == 10.0 assert len(slice_) == 10 * sr # boundaries assert windows[0][0] == 0.0 assert windows[-1][1] == 25.0