From a88594d54be34baa13566a417ed8b358eea439cd Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 29 Oct 2018 15:26:54 +0100 Subject: [PATCH] [py] [slicing] add end of last region if missing --- python/lib/aubio/slicing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/lib/aubio/slicing.py b/python/lib/aubio/slicing.py index a2a25198..2ca116ec 100644 --- a/python/lib/aubio/slicing.py +++ b/python/lib/aubio/slicing.py @@ -18,7 +18,9 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None, timestamps_end = [timestamps[1] - 1] + timestamps_end if timestamps_end is not None: - if len(timestamps_end) != len(timestamps): + if len(timestamps_end) == len(timestamps) - 1: + timestamps_end = timestamps_end + [_max_timestamp] + elif len(timestamps_end) != len(timestamps): raise ValueError("len(timestamps_end) != len(timestamps)") else: timestamps_end = [t - 1 for t in timestamps[1:]] + [_max_timestamp] -- 2.11.0