Skip to content

feat: add FLAC support (import and export) - #194

Merged
thcp merged 1 commit into
mainfrom
feat/flac-support
Jun 5, 2026
Merged

thcp merged 1 commit into
mainfrom
feat/flac-support

Conversation

@thcp

@thcp thcp commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Adds FLAC as a first-class audio format on both sides of StemDeck.

Import

  • Accept .flac uploads alongside .mp3/.wav.
  • The upload is stored as source.flac and decoded by the existing ffmpeg/Demucs path, so no pipeline change is needed - only the allowlist (app/api/jobs.py), the file-picker accept attribute, and the user-facing messages.

Export

  • A third WAV / MP3 / FLAC toggle in the export menu, applied consistently to the mix, the loop region, and the stems .zip.
  • Backend: a shared encoder map drives both the dynamic mixdown endpoint (mixdown.flac -> -c:a flac) and the stems-zip builder (per-stem FLAC transcode). Format validation accepts wav|mp3|flac.
  • Frontend: the per-format *Mp3 mix/region helpers are collapsed into downloadCurrentMix(ext) / downloadRegionMix(ext), so adding FLAC (or any future format) is just one more toggle.

Verification

  • End-to-end against a real job: mixdown.flac and the FLAC stems zip return valid, ffprobe-decodable FLAC; WAV and MP3 still work (regression-checked).
  • Tests: FLAC upload accepted; mixdown.flac happy path (FLAC marker fLaC); FLAC stems zip; format-validation. Full suite 100 passed. ruff + node --check clean.

Files: app/api/jobs.py, app/api/stems.py, static/index.html, static/js/main.js, static/js/player.js, tests.

Import: accept .flac uploads alongside .mp3/.wav. The source is stored as
source.flac and decoded by the existing ffmpeg/Demucs path, so no pipeline
change is needed - just the allowlist, the file picker accept attr, and the
user-facing messages.

Export: add FLAC as a third download format next to WAV/MP3 for the mix,
the loop region, and the stems .zip.
- Backend: a shared codec/encoder map drives the dynamic mixdown endpoint
  (mixdown.flac -> -c:a flac) and the stems-zip builder (per-stem flac
  transcode). Format validation now accepts wav|mp3|flac.
- Frontend: a third WAV/MP3/FLAC toggle in the export menu. The mix/region
  download helpers are parameterized by extension (the per-format Mp3
  variants are collapsed into downloadCurrentMix(ext)/downloadRegionMix(ext)).

Verified end-to-end: mixdown.flac and the flac stems zip return valid,
ffprobe-decodable FLAC; WAV and MP3 still work. Adds upload + export FLAC
tests; full suite 100 passed.
@thcp
thcp marked this pull request as ready for review June 5, 2026 14:36
@thcp
thcp merged commit 0a67593 into main Jun 5, 2026
2 checks passed
@thcp
thcp deleted the feat/flac-support branch June 5, 2026 14:36
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