From 3f98f0ab9413a4f3c66f09ccbe863e0b60d5ebf5 Mon Sep 17 00:00:00 2001 From: Nguyen Lam Vu Date: Fri, 7 Jun 2024 16:15:53 +0700 Subject: [PATCH] - avoid the case len(sil_tags) == 1 that it will return empty output --- slicer2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slicer2.py b/slicer2.py index 0bb6ef0..6f8e307 100644 --- a/slicer2.py +++ b/slicer2.py @@ -127,7 +127,7 @@ def slice(self, waveform): pos = rms_list[silence_start: silence_end + 1].argmin() + silence_start sil_tags.append((pos, total_frames + 1)) # Apply and return slices. - if len(sil_tags) == 0: + if len(sil_tags) <= 1: return [waveform] else: chunks = []