History

python/scripts/aubiocut: use stamp, not onset

Paul Brossier committed 12 years ago

Commit 9d1606d1 parent c7d8cb11 file · +5 −5Browse files

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

Unified · Split

python/scripts/aubiocut+5−5
@@ -173,24 +173,24 @@ if __name__ == '__main__': · 172 unmodified lines
173173 g = sink(new_sink_name(source_base_name, 0.), samplerate)
174174 total_frames = 0
175175 # get next region
176− next_onset = int(timestamps.pop(0))
176+ next_stamp = int(timestamps.pop(0))
177177 while True:
178178 vec, read = s()
179− remaining = next_onset - total_frames
179+ remaining = next_stamp - total_frames
180180 if remaining <= read:
181181 # write remaining samples from current region
182182 g(vec[0:remaining], remaining)
183183 # close this file
184184 del g
185185 # create a new file for the new region
186− g = sink(new_sink_name(source_base_name, next_onset / float(samplerate)), samplerate)
186+ g = sink(new_sink_name(source_base_name, next_stamp / float(samplerate)), samplerate)
187187 # write the remaining samples in the new file
188188 g(vec[remaining:read], read - remaining)
189189 #print "new slice", total_frames_written, "+", remaining, "=", start_of_next_region
190190 if len(timestamps):
191− next_onset = int(timestamps.pop(0))
191+ next_stamp = int(timestamps.pop(0))
192192 else:
193− next_onset = 1e120
193+ next_stamp = 1e120
194194 else:
195195 g(vec[0:read], read)
196196 total_frames += read

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