[py] remove old slices from current list
authorPaul Brossier <piem@piem.org>
Mon, 29 Oct 2018 14:06:12 +0000 (15:06 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 29 Oct 2018 14:06:12 +0000 (15:06 +0100)
python/lib/aubio/slicing.py

index fa9d2e3..3f3602a 100644 (file)
@@ -82,5 +82,8 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None,
                 # write all the samples
                 _sink.do_multi(vec[:, start:read], read - start)
         total_frames += read
+        # remove old slices
+        slices = list(filter(lambda s: s['end_stamp'] > total_frames,
+            slices))
         if read < hopsize:
             break