Subtitles

Subtitles made on the phone, on demand (the viewer's CC button): the video's sound in 30 s windows, the one being watched first, then onward, then from the start; in each, only the speech (SpeechDetector) is transcribed (Whistle) and its words grouped into short lines. Saved per video version, so watching again is instant.

Functions

Link copied to clipboard
fun generate(context: Context, item: MediaRef, fromMs: Long): Flow<List<Cue>>

Cues so far, each emission a fuller list; finished when every window is done.

Link copied to clipboard
fun saved(context: Context, item: MediaRef): Pair<List<Cue>, Boolean>?

Subtitles made so far for item, and whether they cover the whole video; null if none.

Link copied to clipboard
fun srt(cues: List<Cue>): String

The cues as SubRip (.srt), which nearly every player and editor reads.

Link copied to clipboard
fun timestamped(cues: List<Cue>): String

"0:12 Hello there", one line per cue.

Link copied to clipboard
fun vtt(cues: List<Cue>): String

The cues as WebVTT (.vtt), for browsers and web players.