History

[py] [slicing] add end of last region if missing

Paul Brossier committed 8 years ago

Commit a88594d1 parent f0ce8aa1 file · +3 −1Browse files

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

Unified · Split

python/lib/aubio/slicing.py+3−1
@@ -18,7 +18,9 @@ def slice_source_at_stamps(source_file, timestamps, timestamps_end=None, · 17 unmodified lines
18 timestamps_end = [timestamps[1] - 1] + timestamps_end18 timestamps_end = [timestamps[1] - 1] + timestamps_end
19 19
20 if timestamps_end is not None:20 if timestamps_end is not None:
21 if len(timestamps_end) != len(timestamps):21 if len(timestamps_end) == len(timestamps) - 1:
22 timestamps_end = timestamps_end + [_max_timestamp]
23 elif len(timestamps_end) != len(timestamps):
22 raise ValueError("len(timestamps_end) != len(timestamps)")24 raise ValueError("len(timestamps_end) != len(timestamps)")
23 else:25 else:
24 timestamps_end = [t - 1 for t in timestamps[1:]] + [_max_timestamp]26 timestamps_end = [t - 1 for t in timestamps[1:]] + [_max_timestamp]

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