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
173 g = sink(new_sink_name(source_base_name, 0.), samplerate)173 g = sink(new_sink_name(source_base_name, 0.), samplerate)
174 total_frames = 0174 total_frames = 0
175 # get next region175 # get next region
176 next_onset = int(timestamps.pop(0))176 next_stamp = int(timestamps.pop(0))
177 while True:177 while True:
178 vec, read = s()178 vec, read = s()
179 remaining = next_onset - total_frames179 remaining = next_stamp - total_frames
180 if remaining <= read:180 if remaining <= read:
181 # write remaining samples from current region181 # write remaining samples from current region
182 g(vec[0:remaining], remaining)182 g(vec[0:remaining], remaining)
183 # close this file183 # close this file
184 del g184 del g
185 # create a new file for the new region185 # 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)
187 # write the remaining samples in the new file187 # write the remaining samples in the new file
188 g(vec[remaining:read], read - remaining)188 g(vec[remaining:read], read - remaining)
189 #print "new slice", total_frames_written, "+", remaining, "=", start_of_next_region189 #print "new slice", total_frames_written, "+", remaining, "=", start_of_next_region
190 if len(timestamps):190 if len(timestamps):
191 next_onset = int(timestamps.pop(0))191 next_stamp = int(timestamps.pop(0))
192 else:192 else:
193 next_onset = 1e120193 next_stamp = 1e120
194 else:194 else:
195 g(vec[0:read], read)195 g(vec[0:read], read)
196 total_frames += read196 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