History

python/scripts/aubiocut: add --cut_every_nslices option

Paul Brossier committed 9 years ago

Commit e79acd91 parent dcecaec1 file · +7 −0Browse files

Showing the changes to python/scripts/aubiocut (1 of 1 file). Show all

Unified · Split

python/scripts/aubiocut+7−0
@@ -116,6 +116,10 @@ def parse_args(): · 115 unmodified lines
116116 metavar = "<samples>",
117117 action = "store", dest = "cut_until_nsamples", default = None,
118118 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")
119123 parser.add_option("--cut-until-nslices", type = int,
120124 metavar = "<slices>",
121125 action = "store", dest = "cut_until_nslices", default = None,
@@ -186,6 +190,9 @@ if __name__ == '__main__': · 64 unmodified lines
186190 # generate output files
187191 from aubio.slicing import slice_source_at_stamps
188192 timestamps_end = None
193+ if options.cut_every_nslices:
194+ timestamps = timestamps[::options.cut_every_nslices]
195+ nstamps = len(timestamps)
189196 if options.cut_until_nslices and options.cut_until_nsamples:
190197 print ("warning: using cut_until_nslices, but cut_until_nsamples is set")
191198 if options.cut_until_nsamples:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t