From 368f10abb558f994920aa3b8a4e532c850670649 Mon Sep 17 00:00:00 2001 From: h465855hgg <3382198490@qq.com> Date: Sat, 18 Jul 2026 18:59:48 +0800 Subject: [PATCH] fix(lyrics): improve instrumental break detection --- lyrics/lyrics.luau | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lyrics/lyrics.luau b/lyrics/lyrics.luau index 31c6d9d..e529bf6 100644 --- a/lyrics/lyrics.luau +++ b/lyrics/lyrics.luau @@ -75,7 +75,7 @@ local MARQUEE_HOLD = 1.1 local BLEND_MS = 350 local INTERLUDE_GAP_MS = 7000 local INTRO_MIN_MS = 6000 -local INTERLUDE_MIN_MS = 8000 +local INTERLUDE_MIN_MS = 3000 local function shellQuote(value) return "'" .. tostring(value):gsub("'", "'\\''") .. "'" @@ -170,8 +170,13 @@ local function getLineInfo() lineEnd = math.min(nextTime, startTime + line.duration) elseif nextTime - startTime >= INTERLUDE_GAP_MS then -- LRC only marks line starts. Do not stretch a lyric across a long instrumental gap. - local estimatedDuration = clamp(#toChars(line.text) * 320, 3200, 6000) - lineEnd = math.min(nextTime, startTime + estimatedDuration) + local lastCharTime = line.chars and tonumber(line.chars[#line.chars]) or nil + if lastCharTime and lastCharTime >= startTime and lastCharTime < nextTime then + lineEnd = math.min(nextTime, lastCharTime + 600) + else + local estimatedDuration = clamp(#toChars(line.text) * 320, 3200, 6000) + lineEnd = math.min(nextTime, startTime + estimatedDuration) + end end -- Only show an interlude between two real lyric lines. The final lyric stays