Skip to content

Add optional preview_start_time parameter to mix enhance and mastering endpoints#6

Merged
daveronan merged 1 commit into
masterfrom
feat/mastering-offset
May 15, 2026
Merged

Add optional preview_start_time parameter to mix enhance and mastering endpoints#6
daveronan merged 1 commit into
masterfrom
feat/mastering-offset

Conversation

@daveronan
Copy link
Copy Markdown
Collaborator

@daveronan daveronan commented May 15, 2026

Summary

  • Add optional preview_start_time: Optional[float] parameter to MixEnhanceRequest and MasteringRequest models
  • When provided, include previewStartTime in the API request payload under mixReviveData or masteringData; when omitted, existing RMS-based auto-selection is preserved (backward compatible)
  • Parse preview_start_time from retrieve response objects (already implemented in EnhancedTrackResult and PreviewMasterResult)
  • Update docstrings, README examples (also fixes pre-existing incorrect model names and dict access in the enhancement section), and add unit tests covering provided, zero, and omitted cases

Staging verification

All 5 test cases passed on tonn-staging.roexaudio.com:

Input Returned preview_start_time
previewStartTime: 45.0 45.0
No previewStartTime 105.0 (RMS auto)
previewStartTime: 30.0 30.0
previewStartTime: 9999.0 123.67 (clamped)
previewStartTime: 0 0.0

Test plan

  • Unit tests pass (32/32)
  • Staging integration tests pass (5/5)
  • Verify backward compatibility with existing client code that doesn't use the new parameter

Made with Cursor


Note

Low Risk
Low risk additive change: introduces an optional request field that only affects preview segment selection and is omitted by default; main risk is API payload compatibility if backend rejects the new previewStartTime key.

Overview
Adds an optional preview_start_time field to MasteringRequest and MixEnhanceRequest and forwards it as previewStartTime in the /masteringpreview and /mixenhance* request payloads when provided (including 0.0), preserving existing RMS-based auto-selection when omitted.

Updates docs/README examples to show the new parameter and correct typed result access for preview/final URLs, and adds unit tests covering provided/zero/omitted behavior for both controllers.

Reviewed by Cursor Bugbot for commit 30c2c78. Bugbot is set up for automated code reviews on this repo. Configure here.

…g endpoints

Allow users to specify where the 30-second preview segment starts instead
of relying on automatic RMS-based selection. When omitted, existing behavior
is preserved (backward compatible).

- Add preview_start_time field to MixEnhanceRequest and MasteringRequest
- Include previewStartTime in request payloads when provided
- Update docstrings and README with new parameter documentation
- Add unit tests for provided, zero, and omitted cases
- Verified against staging: all 5 integration test cases pass

Co-authored-by: Cursor <cursoragent@cursor.com>
@daveronan daveronan merged commit 8127a90 into master May 15, 2026
1 check passed
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