ref: e79acd95b720f07eda617dcc0c29d7611f64e7dd
parent: dcecaecaa02b5a1a43922303db1a97cf266fa8f6
author: Paul Brossier <piem@piem.org>
date: Wed Mar 8 02:30:00 EST 2017
python/scripts/aubiocut: add --cut_every_nslices option
--- a/python/scripts/aubiocut
+++ b/python/scripts/aubiocut
@@ -116,6 +116,10 @@
metavar = "<samples>",
action = "store", dest = "cut_until_nsamples", default = None,
help="how many extra samples should be added at the end of each slice")
+ parser.add_option("--cut-every-nslices", type = int,
+ metavar = "<samples>",
+ action = "store", dest = "cut_every_nslices", default = None,
+ help="how many slices should be groupped together at each cut")
parser.add_option("--cut-until-nslices", type = int,
metavar = "<slices>",
action = "store", dest = "cut_until_nslices", default = None,
@@ -186,6 +190,9 @@
# generate output files
from aubio.slicing import slice_source_at_stamps
timestamps_end = None
+ if options.cut_every_nslices:
+ timestamps = timestamps[::options.cut_every_nslices]
+ nstamps = len(timestamps)
if options.cut_until_nslices and options.cut_until_nsamples:
print ("warning: using cut_until_nslices, but cut_until_nsamples is set")
if options.cut_until_nsamples: