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:
Gabriel Ziegler
2022-02-09 19:18:48 -03:00
parent 76687cbe25
commit af6931d1de

View File

@@ -240,6 +240,7 @@ def get_speech_timestamps(audio: torch.Tensor,
continue continue
if current_speech: if current_speech:
if (audio_length_samples - current_speech['start']) > min_speech_samples:
current_speech['end'] = audio_length_samples current_speech['end'] = audio_length_samples
speeches.append(current_speech) speeches.append(current_speech)