Skip to content

Add FLAC (.flac) file support#7

Open
akrbout wants to merge 1 commit into
BytePhoenixCoding:mainfrom
akrbout:add-flac-support
Open

Add FLAC (.flac) file support#7
akrbout wants to merge 1 commit into
BytePhoenixCoding:mainfrom
akrbout:add-flac-support

Conversation

@akrbout

@akrbout akrbout commented Jul 13, 2026

Copy link
Copy Markdown

What

Adds support for converting .flac files from Serato crates to rekordbox XML.

Why

FLAC is a popular format for DJs who care about audio quality, but the tool previously skipped all .flac files with Unsupported format: .flac. In my library that was ~1300 tracks out of ~4200.

How

  • New extract_flac.py module using mutagen.flac.FLAC
  • Serato stores markers in FLAC as Vorbis comments (SERATO_MARKERS_V2, SERATO_BEATGRID) — the payload format is identical to M4A (double base64 with application/octet-stream wrapper)
  • Reuses extract_m4a.parse_serato_hot_cues() for hot cues (same double-base64 format)
  • Reuses extract_mp3.parse_beatgrid_markers() for beatgrid (same binary structure after base64 decode)
  • Reads BPM from BPM/TBPM Vorbis comments, key from INITIALKEY
  • Updated serato2rekordbox.py: added .flac to format dispatcher and Kind mapping (FLAC File)

Testing

Tested on my Serato library (~4200 tracks, ~1300 FLAC):

  • Before: 2898 tracks converted, ~1300 FLAC files skipped as unsupported
  • After: 4198 tracks converted, 0 FLAC-related failures
  • Hot cues, beatgrids, BPM, and key all correctly extracted from FLAC files
  • A handful of corrupt/invalid FLAC files are gracefully handled as errors (same as corrupt MP3/M4A would be)

Files changed

  • extract_flac.py (new, 164 lines)
  • serato2rekordbox.py (+8 lines: import, format dispatch, Kind mapping)

…c files

- New extract_flac.py module using mutagen.flac.FLAC
- Reuses m4a double-base64 parser for SERATO_MARKERS_V2 (same format)
- Reuses mp3 beatgrid parser for SERATO_BEATGRID (same binary structure)
- Reads BPM from 'BPM'/'TBPM' Vorbis comments
- Reads key from INITIALKEY Vorbis comment, converts to Camelot
- Updated serato2rekordbox.py: added .flac to format dispatcher and Kind mapping
- Tested on library with 1300+ FLAC files: all processed successfully
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.

1 participant