python/scripts/aubiocut: use stamp, not onset
authorPaul Brossier <piem@piem.org>
Sat, 11 Jan 2014 16:45:18 +0000 (12:45 -0400)
committerPaul Brossier <piem@piem.org>
Sat, 11 Jan 2014 16:45:18 +0000 (12:45 -0400)
python/scripts/aubiocut

index ba66eee..48aa3e1 100755 (executable)
@@ -173,24 +173,24 @@ if __name__ == '__main__':
         g = sink(new_sink_name(source_base_name, 0.), samplerate)
         total_frames = 0
         # get next region
-        next_onset = int(timestamps.pop(0))
+        next_stamp = int(timestamps.pop(0))
         while True:
             vec, read = s()
-            remaining = next_onset - total_frames
+            remaining = next_stamp - total_frames
             if remaining <= read:
                 # write remaining samples from current region
                 g(vec[0:remaining], remaining)
                 # close this file
                 del g
                 # create a new file for the new region
-                g = sink(new_sink_name(source_base_name, next_onset / float(samplerate)), samplerate)
+                g = sink(new_sink_name(source_base_name, next_stamp / float(samplerate)), samplerate)
                 # write the remaining samples in the new file
                 g(vec[remaining:read], read - remaining)
                 #print "new slice", total_frames_written, "+", remaining, "=", start_of_next_region
                 if len(timestamps):
-                    next_onset = int(timestamps.pop(0))
+                    next_stamp = int(timestamps.pop(0))
                 else:
-                    next_onset = 1e120
+                    next_stamp = 1e120
             else:
                 g(vec[0:read], read)
             total_frames += read