Skip to content

fix(lyrics): restore Kugou KRC sync with offset parsing, credit filtering, and whitespace token handling - #274

Merged
ajisth69 merged 1 commit into
mainfrom
fix/kugou-lyrics-sync
Oct 6, 2026
Merged

ajisth69 merged 1 commit into
mainfrom
fix/kugou-lyrics-sync

Conversation

@ajisth69

@ajisth69 ajisth69 commented Oct 5, 2026

Copy link
Copy Markdown
Member

Summary

Fixes word and line synchronization issues when playing Kugou lyrics.

Root Causes & Fixes

  1. Global Offset Header Ignored:
    • Author [offset:X]\ headers in KRC payloads were skipped by line regex.
    • Now parsed with \krcOffsetRegex\ and applied to line and syllable timestamps.
  2. Author/Song Credit Lines Filtered:
    • Introductory metadata (e.g. \Lyrics by:, \Composed by:, \Title - Artist) previously occupied 0–15s of playback with artificial or disordered timestamps.
    • Now filtered out via \isCreditLine\ and \creditLineRegex\ so playback and auto-scroll focus cleanly on actual sung vocals.
  3. Whitespace Syllables Breaking Word Alignment:
    • Isolated whitespace syllable tokens (<...,...,0> ) caused \KaraokeLineSplitter.alignFragmentsToWords\ to abort on \strippedAtoms.any { it.isEmpty() }, collapsing into unmerged fragments.
    • Whitespace tokens now glue to previous syllables as trailing spaces rather than entering the syllable stream as empty words.
    • Also hardened \�lignFragmentsToWords\ to skip blank pieces defensively.
  4. YouTube Track Title Search & Matching:
    • Strips leading \Artist - \ prefixes from title queries so YouTube video titles match Kugou candidate track names seamlessly.

@ajisth69
ajisth69 merged commit 55b6bb8 into main Oct 6, 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