Skip to content

feat(settings): export sample rate option + reorganize settings tabs - #270

Merged
thcp merged 2 commits into
mainfrom
feat/export-sample-rate-and-settings-tabs
Jul 16, 2026
Merged

feat(settings): export sample rate option + reorganize settings tabs#270
thcp merged 2 commits into
mainfrom
feat/export-sample-rate-and-settings-tabs

Conversation

@thcp

@thcp thcp commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #271

Why

A user reported their Akai MPC rejects exported mixes ("always exports at 1411 kbps"). Exports were locked to the stems' native 44.1 kHz with no way to change it. This adds a configurable export sample rate, and while in the Settings dialog, reorganizes it into clearer tabs.

What

Export sample rate (the core feature)

  • New runtime setting export_sample_rate (allowlist: 22.05 / 32 / 44.1 / 48 kHz; default 44.1 kHz = the Demucs stem rate, so a no-op unless changed).
  • Read live by the mixdown endpoint and applied via ffmpeg -ar, so it covers the full mix, region exports, and the mobile client — everything routes through the one get_mixdown command.
  • Off-allowlist values are rejected (422), not clamped.

Settings dialog reorganized: General / Network / Export

  • General — max track length, compute device, out-of-sync tracks
  • Network — network availability toggle + QR codes, Port (moved here — it's a network setting)
  • Export — sample rate, MP4 video quality (moved here)

Smaller fixes bundled in

  • Port field shows the live serving port rather than the stale saved preference; editing still persists the preference for the next restart.
  • In server mode the network toggle now renders on + read-only, with an inline note explaining it's governed by server configuration.

Testing

  • pytest tests/test_stems_api.py tests/test_network_gate.py → 65 passed (incl. a new test decoding the WAV header to confirm the -ar rate takes effect, and settings round-trip / allowlist-rejection tests).
  • ruff check + ruff format --check clean.
  • Manually verified the reorganized tabs, live port, and server-mode toggle in a running instance.

Thales added 2 commits July 16, 2026 12:49
Add a configurable export sample rate for mix/region downloads (WAV/FLAC/
MP3), addressing hardware samplers (e.g. Akai MPC) that reject 44.1 kHz.
The rate is a runtime setting read live by the mixdown endpoint, applied
via ffmpeg -ar; default 44.1 kHz (the stem rate) is a no-op.

Reorganize the Settings dialog into General / Network / Export tabs:
- General: max track length, compute device, out-of-sync tracks
- Network: availability toggle + QR, Port (moved here)
- Export: sample rate, MP4 video quality (moved here)

Also:
- Port field now shows the live serving port, not the stale saved
  preference (editing still saves the preference for next restart).
- In server mode the network toggle renders on + read-only, with an
  inline note explaining it is governed by server configuration.
Pin the settings dialog to a fixed height and let every pane fill it
(flex:1), so switching between General / Network / Export no longer
resizes the dialog. The General pane scrolls within the fixed area.

Refs #271
@thcp
thcp merged commit 3359ed0 into main Jul 16, 2026
8 checks passed
@thcp
thcp deleted the feat/export-sample-rate-and-settings-tabs branch July 16, 2026 14:33
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.

Export mix at a configurable sample rate (hardware samplers reject 44.1 kHz)

1 participant