Add optional preview_start_time parameter to mix enhance and mastering endpoints#6
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
preview_start_time: Optional[float]parameter toMixEnhanceRequestandMasteringRequestmodelspreviewStartTimein the API request payload undermixReviveDataormasteringData; when omitted, existing RMS-based auto-selection is preserved (backward compatible)preview_start_timefrom retrieve response objects (already implemented inEnhancedTrackResultandPreviewMasterResult)Staging verification
All 5 test cases passed on
tonn-staging.roexaudio.com:preview_start_timepreviewStartTime: 45.045.0previewStartTime105.0(RMS auto)previewStartTime: 30.030.0previewStartTime: 9999.0123.67(clamped)previewStartTime: 00.0Test plan
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
previewStartTimekey.Overview
Adds an optional
preview_start_timefield toMasteringRequestandMixEnhanceRequestand forwards it aspreviewStartTimein the/masteringpreviewand/mixenhance*request payloads when provided (including0.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.