From: Paul Brossier Date: Sat, 28 May 2005 22:11:38 +0000 (+0000) Subject: really fix buffer size settings in new aubiocut X-Git-Tag: bzr2git~898 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=382c42e605dcb4d429d10313fd6ac4e228d47b70;p=aubio.git really fix buffer size settings in new aubiocut --- diff --git a/python/aubiocut b/python/aubiocut index 8242bf9d..07125e24 100755 --- a/python/aubiocut +++ b/python/aubiocut @@ -93,11 +93,12 @@ options, args = parse_args() filename = options.filename samplerate = float(sndfile(filename).samplerate()) -hopsize = float(options.hopsize) -bufsize = float(options.bufsize) +hopsize = int(options.hopsize) +bufsize = int(options.bufsize) +step = float(samplerate)/float(hopsize) threshold = float(options.threshold) silence = float(options.silence) -mintol = float(options.mintol)*samplerate/hopsize +mintol = float(options.mintol)*step delay = float(options.delay) if options.beat: @@ -111,7 +112,7 @@ else: # take back system delay if delay != 0: for i in range(len(onsets)): - onsets[i] -= delay*samplerate/hopsize + onsets[i] -= delay*step # prune doubled if mintol > 0: @@ -125,7 +126,7 @@ if mintol > 0: # print times in second if options.verbose: - for i in onsets: print "%f" % (i*hopsize/samplerate) + for i in onsets: print "%f" % (i/step) if options.cut: cutfile(filename,onsets,bufsize=bufsize,hopsize=hopsize)