ref: 382c42e605dcb4d429d10313fd6ac4e228d47b70
parent: 6b384f3358ed53505cea751de2c1f43947ff8dbc
author: Paul Brossier <piem@altern.org>
date: Sat May 28 18:11:38 EDT 2005
really fix buffer size settings in new aubiocut
--- a/python/aubiocut
+++ b/python/aubiocut
@@ -93,11 +93,12 @@
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 @@
# 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 @@
# 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)