mirror of
https://github.com/snakers4/silero-vad.git
synced 2026-02-05 18:09:22 +08:00
Fix bug where min_speech_duration_ms is not checked in the last speech segment
Signed-off-by: Gabriel Ziegler <gabrielziegler3@gmail.com>
This commit is contained in:
@@ -240,8 +240,9 @@ def get_speech_timestamps(audio: torch.Tensor,
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if current_speech:
|
if current_speech:
|
||||||
current_speech['end'] = audio_length_samples
|
if (audio_length_samples - current_speech['start']) > min_speech_samples:
|
||||||
speeches.append(current_speech)
|
current_speech['end'] = audio_length_samples
|
||||||
|
speeches.append(current_speech)
|
||||||
|
|
||||||
for i, speech in enumerate(speeches):
|
for i, speech in enumerate(speeches):
|
||||||
if i == 0:
|
if i == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user