Scrub API
POST/v1/tools/voice_scriptpriced

Voice a script

Voices a script line by line in a chosen voice, in an accent when one is asked for, as one take with every word's time: each line's stretch of the audio, a changed line voiced again on its own, lines timed to subtitles or a video.

Takes script (text). Returns voice (the voice as one file, each line where it plays), script (the script with each line's stretch of the take, where it plays in the voice file and how long, and every word's time; given again with a line changed, only that line is voiced), timeline (given a video's timeline, the same timeline with each scene's stretch of the take, its length and its word timings set. None when given a script).

$0.01 per 12 seconds of speech, up to 3600 seconds.

Fields

FieldTypeDefaultWhat it is
scriptstring | objectRequiredWhat is said, line by line, as one take in its voice, given exactly as the person wrote it, its notes word for word, never shortened or reworded: text, each paragraph a line (each line when no blank lines part them), a note wholly in brackets never said and a stretch of time in it, 0:00–0:20, where the line after it starts and ends, each part filling its time with its pauses and the voice ending at the last part's end, words before the first time never said; after a bar in the note, [0:00–0:20 | calm, slow], how the part is said; (pause) or (pause 2s) in a line, a pause there; a subtitle file's text, SRT or VTT, each cue a line that starts at its time; {lines: [{id, text, at?, until?, how?}], voice?: {name, accent?}, timing?: fit, cues or straight}, at and until in seconds; or a video's timeline, whose scenes are its lines. A line voiced before, as it reads and in the same voice and accent, is reused; words moved between lines of one take are cut from it again, not voiced. Or the job_id of a finished job that made one, a draft's name (draft_…) or the file_id of one: what it holds is used as it is. Pass it rather than retyping its result. A script is text, or {lines: [{id, text, at?, until?, how?}], voice?: {name: one of Achernar (soft, female), Achird (friendly, male), Algenib (gravelly, male), Algieba (smooth, male), Alnilam (firm, male), Aoede (breezy, female), Autonoe (bright, female), Callirrhoe (easy-going, female), Charon (informative, male), Despina (smooth, female), Enceladus (breathy, male), Erinome (clear, female), Fenrir (excitable, male), Gacrux (mature, female), Iapetus (clear, male), Kore (firm, female), Laomedeia (upbeat, female), Leda (youthful, female), Orus (firm, male), Pulcherrima (forward, female), Puck (upbeat, male), Rasalgethi (informative, male), Sadachbia (lively, male), Sadaltager (knowledgeable, male), Schedar (even, male), Sulafat (warm, female), Umbriel (easy-going, male), Vindemiatrix (gentle, female), Zephyr (bright, female), Zubenelgenubi (casual, male); accent?: the accent it is said in, one of none (The voice's own), scottish (Scottish), irish (Irish), welsh (Welsh), british (British), american (American), australian (Australian) (none when left out; changing it voices every line again)}, timing?: fit (each line starts at its at and fills its time to its until, or to the next line's at, with its pauses; the voice ends at the last until), cues (each line starts at its at, the default for lines) or straight (one after another)}; how: how the line is said, such as calm and slow, never read out; {text, voice?, timing?} reads text as given, and text with times is fitted to them. In text, [0:00–0:16 | calm, slow] before a part times it and says how; (pause) or (pause 2s) in a line is a pause there. A subtitle file's text (SRT or VTT) is read as one line for each cue, at its times. Ids are short names, each used once; a line given back voiced keeps its recording, so send it back as it came to voice only what changed.
deliveryone offollow_the_notesEach part said as the note before it asks, after a bar, [0:00–0:16 | calm, slow], never read out; or one even reading of every part, as written.
follow_the_notesas_written
linesstringSome of the script's lines, by id, comma-separated, to voice only those, each on its own; every other line keeps the voice it has, a changed one still waiting to be voiced. Empty, every line that needs it is voiced.
voiceone ofKoreWho says it, when the script names no voice of its own. Achernar: soft, female Achird: friendly, male Algenib: gravelly, male Algieba: smooth, male Alnilam: firm, male Aoede: breezy, female Autonoe: bright, female Callirrhoe: easy-going, female Charon: informative, male Despina: smooth, female Enceladus: breathy, male Erinome: clear, female Fenrir: excitable, male Gacrux: mature, female Iapetus: clear, male Kore: firm, female Laomedeia: upbeat, female Leda: youthful, female Orus: firm, male Pulcherrima: forward, female Puck: upbeat, male Rasalgethi: informative, male Sadachbia: lively, male Sadaltager: knowledgeable, male Schedar: even, male Sulafat: warm, female Umbriel: easy-going, male Vindemiatrix: gentle, female Zephyr: bright, female Zubenelgenubi: casual, male
AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKoreLaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi
voice_likestringWhat the voice should sound like, in the person's words, such as a calm man, when no voice is named. The voices recommended follow it; it is never read out.
accentone ofnoneThe accent it is said in, with any voice, when the script names none; the voice's own when none is chosen. Changing it voices every line again. none: the voice as it speaks, no accent asked for
nonescottishirishwelshbritishamericanaustralian

Call it

Request

curl -X POST https://app.scrub.app/v1/tools/voice_script \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"script":"w/…/file_id"}'

Answer

{
  "ok": true,
  "result": {
    "job_id": "job_…",
    "status": "running",
    "price_usd": "$…"
  }
}

It starts at once and answers running. Ask job_status with the job_id for its result. quote gives its price first, free.

Every call can also answer an error: what comes back. Try it with your key from Account.