SHADERERA®Video made in code · v0.1.2PluginsAgentsGitHub ↗
← PluginsTypographycomponent · v0.1.0 · MIT
text-timed-cuesOfficial · by Shaderera

Timed cues

Lyrics, subtitles and word timings read from LRC (with word times), SRT, WebVTT and JSON (rows, cues or Whisper segments with words): the line and the word at t, times only.

Add it to a filmOr ask your agent
“Use the shaderera-plugins skill to add text-timed-cues to this film and wire it in, then run check and show me a still.”
Type
component · Typography
Version
0.1.0 · published
Licence
MIT
Built on
No other plugins
npm
No packages
Tags
lyrics, subtitles, captions, lrc, srt, vtt, webvtt, whisper, word timing, karaoke, timed text
Source on GitHub ↗
READMEtext-timed-cues

How to
use it.

Lyrics and subtitles by time: read LRC, SRT, WebVTT or Whisper JSON once, then ask for the line and the word at t.

README.mdexample
import { cueAt, loadTimedText, wordAt } from './type/timed-text.ts'// in openconst lyrics = await loadTimedText(host, 'lyrics/song.lrc')  // .lrc, .srt, .vtt or .json; { trim } if the film starts later// in render(t)const line = cueAt(lyrics, t)    // { start, end, text, words? }, or undefined between cuesconst word = wordAt(lyrics, t)   // { start, end, text }: the word being sung, when the file has words

It gives times only: how a line looks and moves is the film's code.

  • LRC: [mm:ss.xx] line, several stamps on a line for a repeated line, enhanced LRC's <mm:ss.xx> before each word, and [offset:+250] (ms). A line ends where the next starts.
  • SRT and WebVTT: start --> end blocks; tags such as <i> are stripped. No styling or positions are read.
  • JSON: rows of [start, end, "line"], cues like the ones cueAt returns, or Whisper's segments with words (an aligner's output, for word times).
  • parseLrc, parseSrt, parseTimedJson and parseTimedText(path, source) read text you already have; trimCues(cues, s) shifts every time by -s.
More in Typography05 plugins

More in Typography