Documentation 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.
KaraokeSyllable is the atomic unit of karaoke-style lyrics. Each KaraokeLine holds an ordered list of syllables, and each syllable knows exactly when it starts and ends on the playback timeline. This makes it possible to animate word-by-word highlighting at millisecond granularity.
Construction enforces end >= start; an IllegalArgumentException is thrown if that constraint is violated.
Constructor
The display text of this syllable (e.g.
"hel", "lo").Start time in milliseconds. Must be less than or equal to
end.End time in milliseconds. Must be greater than or equal to
start; otherwise construction throws IllegalArgumentException.Optional phonetic (romanized) annotation for this syllable. When present, it is used by
phoneticToString() to build a full phonetic string for the line.Properties
The display text of the syllable.
Start time in milliseconds.
End time in milliseconds.
Optional phonetic annotation;
null when not provided.Computed as
end - start. Always non-negative due to the init constraint.Methods
progress(current: Int): Float
[0.0, 1.0].
| Condition | Return value |
|---|---|
current < start | 0.0 |
current in start..end | (current - start).toFloat() / duration |
current > end | 1.0 |
Current playback position in milliseconds.
Extension functions on Collection<KaraokeSyllable>
These extension functions are defined in the com.mocharealm.accompanist.lyrics.core.model.karaoke.mapper package and operate on any Collection<KaraokeSyllable>.
contentToString()
content of every syllable in the collection with an empty separator, reconstructing the full plain-text line.
phoneticToString()
phonetic value of every syllable with a single space separator. Syllables that have phonetic == null contribute an empty string to the join, which may produce consecutive spaces if phonetic annotations are sparse.