Captions
15 tools: transcribe, enable_captions, set_caption_source, set_caption_style…
transcribe
Transcribe a media item's speech with word-level timings so cut-by-text and captions can work. Runs on-device: Parakeet (fast) for 25 European languages when the browser has WebGPU, Whisper otherwise — model says which ran. Pass a mediaId from get_project_digest / list_media. Returns the detected lang, the model used and the transcript as timed lines ([start–end] text, source seconds) — read them to pick cuts and to proofread captions before fixing words with fix_transcript_word. language (ISO-639-1, e.g. 'ru') forces the spoken language when detection is wrong; force: true re-transcribes media that already has a transcript.
| Input | Type | |
|---|---|---|
mediaId | string | Required |
language | string | |
force | boolean |
enable_captions
Turn burned-in captions on or off for the project.
| Input | Type | |
|---|---|---|
on | boolean | Required |
set_caption_source
Choose which layer's audio drives the captions: 'all', 'main', 'ov:<lane>' or 'tr:<trackId>'.
| Input | Type | |
|---|---|---|
source | string | Required |
set_caption_style
Style the captions. Three ways to call it. (1) A full PRESET — 'tiktok-bold' (karaoke highlight, the social default), 'highlight-pop' (word box), 'clean' (minimal one-word), 'dynamic' (bouncy) — sets look AND animation. (2) An ANIMATION id alone, which changes only how the words arrive and leaves the creator's font/colours/plate untouched: 'word-by-word' (karaoke recolour), 'highlight-box' (box behind the spoken word, with ring), 'highlight-active' (box behind only the current word), 'highlight-trail' (box accumulates under every word spoken so far), 'word-pop' (each word springs in), 'word-fade' (each word fades in), 'word-slide-up' (each word rises into place), 'typewriter' (letter by letter), 'word-blur-in' (each word resolves out of blur), 'word-shake' (lands hard, rattles still), 'one-word' (one word at a time, clean), 'one-word-bounce' (one word, pop + slide), 'line-by-line' (whole line, no per-word motion). (3) A raw style patch (incl. letterSpacing — % of the font size, default 0 — and lineHeight — % of the font size, default 102). See get_guide('captions').
| Input | Type | |
|---|---|---|
preset | string | |
patch | object |
set_caption_segment
Override one caption line's text and/or timing directly (without touching the transcript) — the escape hatch for a single wrong displayed caption. mediaId+segIndex identify the segment; seg = { start, end, text, words? }. Prefer fix_transcript_word for wording (it corrects everywhere); use this for a one-off override.
| Input | Type | |
|---|---|---|
mediaId | string | Required |
segIndex | number | Required |
seg | object | Required |
translate_captions
Show the captions TRANSLATED into another language (in-browser opus-mt; word timings stay the spoken ones). lang ∈ en | es | de | fr | it | pt | ru | nl | zh, or null to go back to the spoken language. Translation builds in the background per media file — the original shows until each track lands, then swaps automatically. Needs transcripts (enable captions / transcribe first).
| Input | Type | |
|---|---|---|
lang | string | null | Required |
align_captions
Re-align word timings to the actual audio energy — the fix when karaoke highlights or text-cuts land a beat off (Whisper's timestamps drift). Snaps every word to its real onset/offset by listening to the waveform. Pass a mediaId to target one clip, or omit to align every transcribed clip on the timeline. Run it after transcribe if timings look loose, before cutting by text.
| Input | Type | |
|---|---|---|
mediaId | string |
fix_transcript_word
Correct a word ASR mis-heard. Locate by source start/end (from digest.transcript.byMedia) and pass the right text. A line-sized window is OK when you also pass from (the current wrong word) — without it, the tool picks the overlapping word most similar to text, or refuses with candidates if several compete. The fix flows to captions AND text-based cuts.
| Input | Type | |
|---|---|---|
mediaId | string | Required |
start | number | Required |
end | number | Required |
text | string | Required |
from | string |
reclean_transcript
Re-run transcript cleanup (decoder loops, artifacts, split suffixes, timing clamps, caption line grouping) over the words already recognised — seconds, no re-transcription, fix_transcript_word edits survive. Use instead of transcribe force:true when the words are right but the lines look messy. Returns the new lines.
| Input | Type | |
|---|---|---|
mediaId | string | Required |
set_caption_position
Move, scale or rotate the whole caption block: x / y (centre offset, −0.5..0.5, y negative = up), scale (1 = default size), rotation (degrees). Keep captions clear of platform UI (get_guide('formats')).
| Input | Type | |
|---|---|---|
x | number | |
y | number | |
scale | number | |
rotation | number |
hide_caption_line
Hide (hidden:true) or bring back (hidden:false) one spoken caption line without touching the transcript or the cut. Each line in get_project_digest transcript.timeline carries its clipId + segIndex; hidden lines are listed under captions.hiddenLines.
| Input | Type | |
|---|---|---|
clipId | string | Required |
segIndex | integer ≥ 0 | Required |
hidden | boolean | Required |
add_caption_line
Add a caption line that nobody speaks (a label, a translation note, a sound cue) from start to end in timeline seconds. It takes the captions' style. Returns its id for update_caption_line / remove_caption_line.
| Input | Type | |
|---|---|---|
start | number ≥ 0 | Required |
end | number | Required |
text | string | Required |
update_caption_line
Change an added caption line's text and/or timing (ids in get_project_digest captions.extras). Spoken lines are corrected with fix_transcript_word or set_caption_segment instead.
| Input | Type | |
|---|---|---|
id | string | Required |
start | number | |
end | number | |
text | string |
remove_caption_line
Delete an added caption line by id (get_project_digest captions.extras).
| Input | Type | |
|---|---|---|
id | string | Required |
reset_caption_edits
Throw away every manual caption edit — text overrides, hidden lines and added lines — so the captions follow the transcript again. One undo step.