Showing the changes to python/scripts (1 of 1 file). Show all
Unified · Split
| @@ -173,24 +173,24 @@ if __name__ == '__main__': · 172 unmodified lines | ||
| 173 | 173 | g = sink(new_sink_name(source_base_name, 0.), samplerate) |
| 174 | 174 | total_frames = 0 |
| 175 | 175 | # get next region |
| 176 | − next_onset = int(timestamps.pop(0)) | |
| 176 | + next_stamp = int(timestamps.pop(0)) | |
| 177 | 177 | while True: |
| 178 | 178 | vec, read = s() |
| 179 | − remaining = next_onset - total_frames | |
| 179 | + remaining = next_stamp - total_frames | |
| 180 | 180 | if remaining <= read: |
| 181 | 181 | # write remaining samples from current region |
| 182 | 182 | g(vec[0:remaining], remaining) |
| 183 | 183 | # close this file |
| 184 | 184 | del g |
| 185 | 185 | # 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 | 187 | # write the remaining samples in the new file |
| 188 | 188 | g(vec[remaining:read], read - remaining) |
| 189 | 189 | #print "new slice", total_frames_written, "+", remaining, "=", start_of_next_region |
| 190 | 190 | if len(timestamps): |
| 191 | − next_onset = int(timestamps.pop(0)) | |
| 191 | + next_stamp = int(timestamps.pop(0)) | |
| 192 | 192 | else: |
| 193 | − next_onset = 1e120 | |
| 193 | + next_stamp = 1e120 | |
| 194 | 194 | else: |
| 195 | 195 | g(vec[0:read], read) |
| 196 | 196 | total_frames += read |