diff --git a/audio_splitter/timestamp.py b/audio_splitter/timestamp.py index aaab1c5..9b6ba11 100644 --- a/audio_splitter/timestamp.py +++ b/audio_splitter/timestamp.py @@ -73,4 +73,15 @@ def resolve_end_times(track_times, total_duration): if end_sec <= start_sec: raise ValueError(f"Track {idx+1}: end time ({end_sec}) is not after start ({start_sec})") resolved.append((start_sec, end_sec)) + + # Warn about overlapping intervals + for idx in range(len(resolved) - 1): + cur_end = resolved[idx][1] + next_start = resolved[idx + 1][0] + if cur_end > next_start: + print( + f"Warning: Track {idx+1} ends at {cur_end}s but Track {idx+2} starts at " + f"{next_start}s — timestamps overlap by {cur_end - next_start:.1f}s." + ) + return resolved