Lyrics

class lava_lyra.lyrics.LyricLine(text: str, time: float, duration: float | None = None)[source]

Bases: object

Single line lyric class

duration: float | None = None
text: str
time: float
class lava_lyra.lyrics.Lyrics(data: dict | None = None)[source]

Bases: object

Lyrics class

get_lyrics_at_time(time_seconds: float, range_seconds: float = 5.0) List[LyricLine][source]

Get lyrics within specified time range

class lava_lyra.lyrics.LyricsManager(player: Player)[source]

Bases: object

Lyrics manager - handles all lyrics related functionalities

property enabled: bool

Check if lyrics feature is enabled on the node

async fetch_lyrics(track=None, skip_track_source: bool = False, lang: str | None = None) Lyrics | None[source]

Fetch lyrics

Args:

track: Track object (default: current track) skip_track_source: Skip track source when searching (NodeLink only) lang: Language code for YouTube captions (NodeLink only)

Returns:

Lyrics object or None

get_current_lyrics_lines(range_seconds: float = 5.0) List[LyricLine][source]

Get lyric lines near the current playback position

property has_lyrics: bool

Check if there are lyrics

Check if current node is NodeLink

property is_subscribed: bool

Check if subscribed to live lyrics

property lyrics: Lyrics | None

Get lyrics of the current track

property lyrics_loaded: bool

Check if lyrics have been attempted to load

mark_not_found() None[source]

Mark lyrics as not found

reset() None[source]

Reset lyrics state

async subscribe_lyrics(skip_track_source: bool = False) bool[source]

Subscribe to live lyrics

Note:
  • Lavalink v4: Full support via POST endpoint

  • NodeLink: Not supported (this is a no-op)

Returns:

bool: True if successful, False otherwise

async unsubscribe_lyrics() bool[source]

Unsubscribe from live lyrics

Note:
  • Lavalink v4: Full support via DELETE endpoint

  • NodeLink: Not supported (resets local state instead)

Returns:

bool: True if successful (or no-op for NodeLink), False otherwise

update_lyrics(data: dict) None[source]

Update lyrics data