Soften voiceover entry/exit with short fades

Add afade in (0.12s) / out (0.25s) to each narration line so it eases in and out
instead of hard-cutting -- the hard cut read as un-cinematic. Voice remains
present and leading (measured onset ramp -18 -> -17 dB).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bg76sLc43Wc3j5ZcLkboYR
This commit is contained in:
JSLMPR 2026-07-22 18:19:27 +02:00
parent aae92ed7a5
commit d3d2a1b14e
1 changed files with 8 additions and 1 deletions

View File

@ -283,8 +283,15 @@ public class HighlightFfmpegRenderer {
command.addAll(List.of("-i", voiceover.path().toString()));
// Narration must clearly lead. Boost ~+8 dB; combined with the lower music bed and side-chain
// ducking, this keeps the voice well above the score during each line.
// Short fades soften the entry/exit so the narration doesn't hard-cut in and out.
double voiceFadeIn = Math.min(0.12, duration / 4);
double voiceFadeOut = Math.min(0.25, duration / 3);
filters.append("[").append(input).append(":a]atrim=duration=").append(duration)
.append(",asetpts=PTS-STARTPTS,volume=1.0,adelay=")
.append(",asetpts=PTS-STARTPTS,volume=1.0")
.append(",afade=t=in:st=0:d=").append(voiceFadeIn)
.append(",afade=t=out:st=").append(Math.max(0.0, duration - voiceFadeOut))
.append(":d=").append(voiceFadeOut)
.append(",adelay=")
.append(delayMillis).append("|").append(delayMillis).append("[").append(label).append("];");
voiceLabels.add("[" + label + "]");
input++;