KRC is the lyrics format used by Kugou Music. It extends the familiar LRC line-timestamp syntax with per-word timing encoded in angle brackets, a base64-encodedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/6xingyv/accompanist-lyrics-core/llms.txt
Use this file to discover all available pages before exploring further.
[language:…] metadata block for embedded translations and phonetics, background vocal lines, and colon-role markers for dual-singer alignment. KugouKrcParser is a Kotlin object (singleton) that decodes all of these features into KaraokeLine instances.
Format
Line and word timing
Every lyric line opens with[lineStartMs,lineDurationMs]. Each word inside the line is preceded by <wordOffsetMs,wordDurationMs,0> where the offset is relative to the line start:
lineStartMs + offset.
Background vocal lines
A background line uses the[bg:…] prefix instead of a timestamp. The syllable timing format inside is identical to a main line. Background lines are parsed and attached to the accompanimentLines list of the immediately preceding MainKaraokeLine:
Colon role markers
A line whose text starts or ends with: (full-width : is also supported) acts as an alignment toggle. The parser tracks the current alignment state and flips it each time it encounters a colon marker:
- The first colon marker switches from
KaraokeAlignment.Start→KaraokeAlignment.End. - The next colon marker switches back to
KaraokeAlignment.Start.
Embedded phonetics and translations
The[language:…] tag holds a base64-encoded JSON structure decoded by KugouKrcMetadataDecoder. After decoding it yields:
phonetics: AList<List<String>>where each inner list holds per-syllable phonetic readings for one lyric line.translations: AList<String>where each entry is the translation for the corresponding lyric line.
KaraokeSyllable.phonetic only when the number of decoded phonetic tokens exactly matches the number of syllables on that line. Translations are stored in KaraokeLine.MainKaraokeLine.translation.
Detection
KugouKrcParser identifies KRC content by requiring both patterns on the same line:
Usage
KugouKrcParser is a Kotlin object—no instantiation required:
Working with the result
SyncedLyrics.lines contains KaraokeLine.MainKaraokeLine entries. Background lines are nested inside accompanimentLines on the main line they follow. There are no SyncedLine entries—KRC always produces syllable-level output:
Minimal example
Timing deduplication
The parser trackslastLineStartTime and advances any line whose declared start time is less than or equal to the previous line’s start time by at least 3 ms. This guards against malformed KRC files where duplicate or out-of-order timestamps would otherwise confuse binary-search playback helpers.
KugouKrcParser is a Kotlin object (singleton). Call it directly as KugouKrcParser.parse(content) without instantiation, just like EnhancedLrcParser and LyricifySyllableParser.