python/lib/aubio/slicing.py: also add end if adding start at 0
authorPaul Brossier <piem@piem.org>
Sun, 12 Jan 2014 07:39:19 +0000 (03:39 -0400)
committerPaul Brossier <piem@piem.org>
Sun, 12 Jan 2014 07:39:19 +0000 (03:39 -0400)
python/lib/aubio/slicing.py

index 0cf05fb..e96a0d8 100644 (file)
@@ -13,6 +13,8 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end = None,
 
     if timestamps[0] != 0:
         timestamps = [0] + timestamps
+        if timestamps_end != None:
+            timestamps_end = [timestamps[1] - 1] + timestamps_end
 
     if timestamps_end != None:
         if len(timestamps_end) != len(timestamps):