Accompanist Lyrics Core is designed so that the most common use case — reading a lyrics string from a file or network response and getting structured, timed lines back — requires almost no configuration. The following walkthrough takes you from zero to a fully navigableDocumentation 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.
SyncedLyrics object, then shows how to look up the active line by playback time and export the result to LRC.
Add the dependency
Add the artifact to your See the Installation guide for version catalogs, KMP target details, and repository setup.
build.gradle.kts. If you are working in a Kotlin Multiplatform project, place it in commonMain.Parse lyrics with AutoParser
AutoParser accepts a raw lyrics string and automatically detects the format by running each registered parser’s canParse() check in sequence. The first parser that claims the content handles the parse.The default
AutoParser checks parsers in this order: TTMLParser → LyricifySyllableParser → EnhancedLrcParser → KugouKrcParser. Standard LRC files are handled by EnhancedLrcParser, which also produces syllable-level output when Enhanced LRC word-timing tags are present. If no parser recognises the content, AutoParser returns an empty SyncedLyrics.Access lines and timing data
Every entry in
lyrics.lines implements ISyncedLine, which guarantees start, end, and duration in milliseconds. Use a when expression to branch on the concrete type and access format-specific data.Get the current line by playback time
SyncedLyrics provides a binary-search helper that returns the index of the line that should be highlighted at a given playback position. Pass the current position in milliseconds and use the returned index to scroll or highlight your UI.Both timing functions perform a binary search on the
lines list and are safe to call on every UI frame or playback tick — they do not iterate the full list.Export to LRC
Use Example output for a two-line parsed file:
LrcExporter to serialise a SyncedLyrics object back into a standard LRC string. Karaoke lines are automatically flattened to plain text, and translation lines are written as duplicate timestamps. Title and artist metadata are written as [ti:] and [ar:] ID3 tags.Next steps
Now that you can parse, navigate, and export lyrics, explore the rest of the documentation:- Parsers Overview — learn about the individual parsers, their detection heuristics, and which features each format supports.
- Exporters Overview — details on
LrcExporterand theILyricsExporterinterface for building custom exporters. - Custom Parser Guide — implement
ILyricsParserand register it withAutoParserto handle any proprietary format.