Accompanist Lyrics UI does not read lyric files directly. All parsing is handled by the companionDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/6xingyv/accompanist-lyrics-ui/llms.txt
Use this file to discover all available pages before exploring further.
lyrics-core library (dependency: com.mocharealm.accompanist:lyrics-core), which converts each supported format into a SyncedLyrics object. That object is then passed unchanged to KaraokeLyricsView. This clean separation means the rendering layer never needs to know which file format was originally used — it only ever sees the shared data model.
Apple Music TTML
TTML (Timed Text Markup Language) as used by Apple Music is the primary format supported bylyrics-core and the one that unlocks all rendering features of the library. The root <tt> element carries the itunes:timing="Word" attribute, which signals that each <span> inside a <p> block has its own begin and end timestamps — this is what enables syllable-level karaoke animations.
Background / harmony vocals are wrapped in a <span ttm:role="x-bg"> container inside the same <p> element as the lead vocal. The parser maps these to KaraokeLine.AccompanimentKaraokeLine instances.
Example (golden-hour.ttml)
The following is an excerpt from thegolden-hour.ttml sample asset, showing the first three lyric paragraphs. The third paragraph (L3) demonstrates the x-bg background vocal feature:
| Attribute | Where | Meaning |
|---|---|---|
itunes:timing="Word" | <tt> | Declares that each <span> has word/syllable-level timestamps |
begin / end on <span> | <span> | Start and end time of each syllable in mm:ss.xxx format |
ttm:role="x-bg" | outer <span> | Marks the enclosed spans as a background/harmony vocal line |
itunes:key | <p> | Unique stable identifier for each line (used for scrolling anchors) |
LRC
LRC is a plain-text format that attaches a single[mm:ss.xx] timestamp to each line of lyrics. There is no syllable-level timing, so lyrics-core maps each LRC entry to a SyncedLine rather than a KaraokeLine. The rendering falls back to the simpler SyncedLineText composable, which uses a vertical float animation instead of the karaoke gradient.
LYS
LYS is the native format of the Accompanist ecosystem. It encodes syllable-level timing compactly on a single line per lyric phrase, with each word followed by its(start_ms, duration_ms) pair in parentheses. Voice/agent identifiers appear at the start of each line (e.g., [4] for the main voice, [7] for the background voice, [5] for a second lead voice).
Example (me.lys)
word(start_ms, duration_ms). The parser reconstructs start and end in milliseconds for each KaraokeSyllable. The [7] voice tag produces an AccompanimentKaraokeLine that is paired with the nearest main-voice line.
Choosing a Format
All format parsing is provided by the
lyrics-core library. See the repository at https://github.com/6xingyv/Accompanist-Lyrics for the full parser API and additional details on each format.| Format | Syllable-level timing | Multi-voice / duet | Translations | Notes |
|---|---|---|---|---|
| TTML | ✓ | ✓ | External file | Apple Music standard; broadest ecosystem support |
| LRC | ✗ | ✗ | Separate .lrc file | Widely available; simplest to author |
| LYS | ✓ | ✓ | Built-in | Native Accompanist format; compact single-file representation |
TTML
Best choice when sourcing lyrics from Apple Music or when maximum animation quality is needed. The
x-bg mechanism makes duet handling straightforward.LRC
Good fallback when only line-level timing is available. Renders cleanly with the
SyncedLineText composable and still supports the focus, blur, and spring-placement animations.LYS
Ideal for first-party content or tools in the Accompanist ecosystem. Encodes all features — syllable timing, multi-voice, phonetics — in a single compact file.