gitlabEdit

microphone-standLyrics

What's being said in your song?

BassBoom knows not only what music is playing, but also the words of the song by themselves. However, you'll need to provide a way for BassBoom to be able to synchronize the music with the lyrics, such as subtitling.

circle-info

BassBoom supports two types of .lrc or .txt lyrics:

  • Standard: Time in lines

  • Extended: Time in lines and words


Usage

You can use the lyrics reader class to manage the lyrics and to make your app synchronize the lyrics with the music.

chevron-rightUsage of the LyricReader classhashtag

Just use the LyricReader class that contains:

Function
Description

GetLyrics(string)

Obtains a list of lyrics from a .lrc or .txt file

circle-info

The string in this function must be a complete path to your .lrc or .txt file containing lyric information about your music.


Parsing of the lyrics

Basolia starts working on your provided lyric file by reading all the lines and verifies that all lines are valid lyric lines. Then, it processes the line according to the following:

chevron-rightSimple lyric linehashtag

In case the lyric line contains just the time span and the lyrics, Basolia parses it to a TimeSpan and takes the lyrics from the line. Below shows the clarification of this process:

[01:13.40]Don't believe me, just watch!
 ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  |        |
  |        \- Lyric line
  \---------- Time of the lyric
chevron-rightComplex lyric linehashtag

In case the lyric line contains time spans of when the words are said, defined like below:

Basolia will attempt to split these words to their time spans, or 00:00 if these time spans can't be found in the line.

Once this is done, Basolia will install all the lyric lines (LyricLine class) to the list of lines in a new Lyric class instance, therefore returning it for usage in your applications.


Structure of the lyrics

The structure of the lyrics, which the lyrics reader class uses, is defined by Basolia to simplify the process of processing the lyrics.

chevron-rightLyric class propertieshashtag

The function returns a Lyric that contains information about your lyric, including a list of lyric lines defined with the LyricLine class. It contains:

Property
Description

Line

A lyric line

LineSpan

Time of when a lyric line gets played

LineWords

Group of words from the lyric line

LyricLineWord also contains these variables:

Property
Description

Word

A lyric word

WordSpan

Time of when a word gets said

chevron-rightLyric class functionshashtag

A Lyric instance contains several functions that allow you to get various lyric lines, such as getting them from the start to the current duration, and from current duration to the end. These functions allow you to perform these operations:

Function
Description

GetLinesCurrent()

Gets all the lines from the start to the current music duration

GetLinesUpcoming()

Gets all the lines from the current music duration to the end

GetLastLineCurrent()

Gets the last lyric line from the current music duration

GetLastLineWordsCurrent()

Gets the last lyric line words from the current music duration

GetLinesToSpan()

Gets all the lines from the start to the current span

GetLinesFromSpan()

Gets all the lines from the current span to the end

GetLastLineAtSpan()

Gets the last lyric line from the given time span

GetLastLineWordsAtSpan()

Gets the last lyric line words from the given time span

circle-info

While the first four functions require you to specify a working Basolia media instance to deal with the current duration, the last four functions don't require this instance, but require specifying a time span representing the target duration.

chevron-rightExample of lyrics processinghashtag

If you want a simple console app that lets you print the lyric lines as they play to simulate the lyric player feature usually found in your music player, the most minimal example of such an application is this:

triangle-exclamation

Last updated