ref: a88594d54be34baa13566a417ed8b358eea439cd
parent: f0ce8aa38a9a315283eab3f2244fb0cbfc4bca08
author: Paul Brossier <piem@piem.org>
date: Mon Oct 29 11:26:54 EDT 2018
[py] [slicing] add end of last region if missing
--- a/python/lib/aubio/slicing.py
+++ b/python/lib/aubio/slicing.py
@@ -18,7 +18,9 @@
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]