Skip to content

Clamp the skip fade to the outgoing track's remaining audio - #102

Closed
sanylax2 wants to merge 1 commit into
mainfrom
claude/repo-review-improvements-yvk3t7-skip-fade-clamp
Closed

sanylax2 wants to merge 1 commit into
mainfrom
claude/repo-review-improvements-yvk3t7-skip-fade-clamp

Conversation

@sanylax2

Copy link
Copy Markdown
Collaborator

What

Stacked on #100 (merge that first; if #100 already merged, retarget this to main). Fixes the audible hard cut reported when skipping the first track of a playlist at ~26 s.

Why

The fixed 5 s skip blend never checked how much outgoing audio remains. On a short track (or hot ending), a skip near the end starts a 5 s fade with, say, 4 s of audio left — the outgoing file drains mid-fade while its equal-power gain is still ~30%, so the sound stops instantly instead of fading. That reads as a hard cut in the middle of an otherwise smooth blend.

How

next() clamps the blend duration to effectiveEndSeconds - position (the audible time actually left, respecting silence trimming), and falls back to the plain hard cut when under 1 second remains — too little to read as a blend.

Testing

On device with that playlist: skip the first track at ~26 s again — the mix-out should now complete within the remaining audio, no drop. Skips mid-track (plenty of remaining audio) still get the full 5 s fade.

🤖 Generated with Claude Code

https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP


Generated by Claude Code

A fixed 5 s skip blend with less than 5 s of outgoing audio left ends
in the file draining mid-fade at ~30% gain — an audible hard cut on
short tracks and hot endings (reported skipping the first track of a
playlist at ~26 s). Clamp the fade to the remaining audible time and
fall back to a hard cut when under a second remains.
@sanylax2
sanylax2 changed the base branch from claude/repo-review-improvements-yvk3t7-smooth-skips to main July 19, 2026 04:09
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.

3 participants