A command line programme to generate SRT format subtitles for use in video players.
The subtitles are generated from the full transcript text of a video. By default, each subtitle will have a maximum of 10 words.
Youngling. Actively-developed.
$ subtitles INPUT-FILENAME.txt LENGTH-IN-SECONDS > OUTPUT-FILENAME.srt
$ subtitles transcript.txt 300 > subtitles.srt # True example
``` import init, * as subtitles from 'path/to/subtitles.js';
(async () => await init())();
let transcripttext = 'Lots of text goes here; newline is acceptable.'; let audiolengthinseconds = 99;
const textforsrtfile = subtitles.preparesrtcontent(transcripttext, audiolengthin_seconds); ```
$ cargo build --release
Install wasm-pack. Then...
$ wasm-pack build --target web
$ cp pkg/{subtitles_bg.wasm,subtitles.js} /path/to/website/js/