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,8 +240,9 @@ def get_speech_timestamps(audio: torch.Tensor,
continue
if current_speech:
current_speech['end'] = audio_length_samples
speeches.append(current_speech)
if (audio_length_samples - current_speech['start']) > min_speech_samples:
current_speech['end'] = audio_length_samples
speeches.append(current_speech)
for i, speech in enumerate(speeches):
if i == 0: