Skip to content

Add MP3 overlap detection utility - #2

Draft
michnov with Copilot wants to merge 4 commits into
mainfrom
copilot/data-preparationoverlap-detection
Draft

Add MP3 overlap detection utility#2
michnov with Copilot wants to merge 4 commits into
mainfrom
copilot/data-preparationoverlap-detection

Conversation

Copilot AI commented Sep 2, 2026

Copy link
Copy Markdown

Two MP3 recordings need automated overlap detection with timestamped results for each source.

  • Audio decoding: Converts both MP3 inputs to mono PCM through ffmpeg.
  • Alignment: Uses NumPy FFT cross-correlation to identify shared audio.
  • Segmentation: Groups matching frames into contiguous overlap intervals.
  • Reporting: Prints readable start/end timestamps for both recordings.
python3 data_preparation/overlap_detection/detect_overlap.py recording1.mp3 recording2.mp3

Co-authored-by: michnov <11574860+michnov@users.noreply.github.com>
@michnov

michnov commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

@copilot what if we assume that one recording is just entirely included in the other one. Would the calculation change and is it higher chance to get the times of the entire contiguous segment, not just tens of non-contiguous segments?

Copilot AI and others added 3 commits September 2, 2026 15:20
Co-authored-by: michnov <11574860+michnov@users.noreply.github.com>
Co-authored-by: michnov <11574860+michnov@users.noreply.github.com>
Co-authored-by: michnov <11574860+michnov@users.noreply.github.com>

Copilot AI commented Sep 2, 2026

Copy link
Copy Markdown
Author

@copilot what if we assume that one recording is just entirely included in the other one. Would the calculation change and is it higher chance to get the times of the entire contiguous se...

Implemented a --mode contained switch. It searches for the shorter recording inside the longer one using normalized sliding correlation and reports one contiguous interval, while --mode general preserves the original behavior. Changes are in ea96353 (with the finalization commit 6c66a55).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants