Showing the changes to python/scripts (1 of 1 file). Show all
Unified · Split
| @@ -116,6 +116,10 @@ def parse_args(): · 115 unmodified lines | ||
| 116 | 116 | metavar = "<samples>", |
| 117 | 117 | action = "store", dest = "cut_until_nsamples", default = None, |
| 118 | 118 | help="how many extra samples should be added at the end of each slice") |
| 119 | + parser.add_option("--cut-every-nslices", type = int, | |
| 120 | + metavar = "<samples>", | |
| 121 | + action = "store", dest = "cut_every_nslices", default = None, | |
| 122 | + help="how many slices should be groupped together at each cut") | |
| 119 | 123 | parser.add_option("--cut-until-nslices", type = int, |
| 120 | 124 | metavar = "<slices>", |
| 121 | 125 | action = "store", dest = "cut_until_nslices", default = None, |
| @@ -186,6 +190,9 @@ if __name__ == '__main__': · 64 unmodified lines | ||
| 186 | 190 | # generate output files |
| 187 | 191 | from aubio.slicing import slice_source_at_stamps |
| 188 | 192 | timestamps_end = None |
| 193 | + if options.cut_every_nslices: | |
| 194 | + timestamps = timestamps[::options.cut_every_nslices] | |
| 195 | + nstamps = len(timestamps) | |
| 189 | 196 | if options.cut_until_nslices and options.cut_until_nsamples: |
| 190 | 197 | print ("warning: using cut_until_nslices, but cut_until_nsamples is set") |
| 191 | 198 | if options.cut_until_nsamples: |