Fix VAD tie-break to prefer latest max-silence candidate
## Summary
When `use_max_poss_sil_at_max_speech=True`, `get_speech_timestamps` currently picks the first candidate when multiple silence candidates have the same duration.
## Problem
`max(possible_ends, key=lambda x: x[1])` breaks ties by first occurrence, which biases the split point toward older silence segments instead of the most recent one near the max-speech boundary.
## Fix
Use recency as a tie-breaker:
- from: `key=lambda x: x[1]`
- to: `key=lambda x: (x[1], x[0])`
This preserves the longest-silence behavior and, on ties, chooses the latest candidate.
## Tests
Added `tests/test_vad.py`:
- `test_get_speech_timestamps_prefers_latest_silence_on_tie`
Ran:
- `pytest -q tests/test_vad.py` (Passed)
合并状态:未合并 关闭于 2026-02-08 29 条评论