History

really fix buffer size settings in new aubiocut

Paul Brossier committed 21 years ago

Commit 382c42e1 parent 6b384f31 file · +6 −5Browse files

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

Unified · Split

python/aubiocut+6−5
@@ -93,11 +93,12 @@ options, args = parse_args() · 92 unmodified lines
9393
9494 filename = options.filename
9595 samplerate = float(sndfile(filename).samplerate())
96−hopsize = float(options.hopsize)
97−bufsize = float(options.bufsize)
96+hopsize = int(options.hopsize)
97+bufsize = int(options.bufsize)
98+step = float(samplerate)/float(hopsize)
9899 threshold = float(options.threshold)
99100 silence = float(options.silence)
100−mintol = float(options.mintol)*samplerate/hopsize
101+mintol = float(options.mintol)*step
101102 delay = float(options.delay)
102103
103104 if options.beat:
@@ -111,7 +112,7 @@ else: · 7 unmodified lines
111112 # take back system delay
112113 if delay != 0:
113114 for i in range(len(onsets)):
114− onsets[i] -= delay*samplerate/hopsize
115+ onsets[i] -= delay*step
115116
116117 # prune doubled
117118 if mintol > 0:
@@ -125,7 +126,7 @@ if mintol > 0: · 7 unmodified lines
125126
126127 # print times in second
127128 if options.verbose:
128− for i in onsets: print "%f" % (i*hopsize/samplerate)
129+ for i in onsets: print "%f" % (i/step)
129130
130131 if options.cut:
131132 cutfile(filename,onsets,bufsize=bufsize,hopsize=hopsize)

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