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 (1 of 1 file). Show all

Unified · Split

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