Class Lyrics

java.lang.Object
lol.trq.orpheus.lyrics.Lyrics

public final class Lyrics extends Object
The lyrics of one track. Immutable; lookups allocate nothing and may run on any thread.
  • Field Details

    • NONE

      public static final Lyrics NONE
  • Constructor Details

    • Lyrics

      public Lyrics(Lyrics.Kind kind, List<LyricLine> lines, long offsetMillis, String source, double confidence)
      Parameters:
      kind - how the lines are timed
      lines - the lines, ordered by start time for synced kinds
      offsetMillis - a correction: positive values show every line earlier
      source - where the lyrics came from, for display
      confidence - how sure the match to the track is, 0 to 1
  • Method Details

    • kind

      public Lyrics.Kind kind()
    • synced

      public boolean synced()
    • size

      public int size()
    • line

      public LyricLine line(int index)
    • lines

      public List<LyricLine> lines()
    • offsetMillis

      public long offsetMillis()
    • source

      public String source()
    • confidence

      public double confidence()
    • withOffset

      public Lyrics withOffset(long millis)
    • withMatch

      public Lyrics withMatch(String newSource, double newConfidence)
    • lineAt

      public int lineAt(long positionMillis)
      The line being sung at a position.
      Returns:
      the index of the last line that has started, or -1 before the first line and for unsynced lyrics
    • wordAt

      public int wordAt(int lineIndex, long positionMillis)
      The word being sung inside a line.
      Returns:
      the index into line(lineIndex).words(), or -1 before the first word or when the line has none