Narration and captions

Rolling can narrate a demo and caption it, lighting up each word as it’s said. The speech is Kokoro, running on the Mac itself through Core ML on the Neural Engine and GPU: about 30 times faster than it’s spoken, with no service and nothing sent anywhere.

say "…"line, voice, pacevoice models240 MB, asked firstKokoroon this Mac30× faster than saidword timingsfitted to the soundone timelinerecording timedemo.mp4voice + captionssubtitles.srt and .vttstudiothe same, live1234
  1. Write a line In a script, while recording, or afterwards. Pick one of 28 voices and a pace. One voice speaks at a time, and a line never talks over the one before it.
  2. Spoken on your Mac Kokoro runs on the Neural Engine and GPU, with no service and nothing sent anywhere. The models download once, and only after Rolling asks.
  3. Every word timed Each word’s time comes from the speech model and is then fitted to where its sound starts and stops, so a caption word never lights up during a pause.
  4. One timeline everywhere The render, the subtitle files and the studio’s player all read the same timeline, and rolling sync checks them to within 12 ms.

The voice models

Narration needs about 240 MB of models, downloaded once into ~/Library/Application Support/Rolling/kokoro, pinned to one revision and checked by SHA-256. Nothing downloads without asking. The welcome offers them, the studio asks the first time you play or re-voice, and a terminal asks before going ahead. An agent is told to run rolling voice get.

Lines

Terminal
rolling voice get                                  # the models, once (about 240 MB)
rolling voice list                                 # 28 voices; af_heart is the default
rolling voice say "Hello there" --voice bm_george --out hi.m4a
rolling say demo --at 2.5 "Open the palette with Command K"   # after recording
rolling mark say "Now the export"                  # while recording
rolling say demo --clear                           # take it out
rolling say demo --revoice --voice bm_george --pace 1.1   # say it all again

In a script, a say step narrates at that point. Speech for every line is made before recording starts, and the next step waits until the line has been said, plus narrationTail (0.35 s), unless overlap lets it carry on.

steps
{ "say": "This is Rolling.", "voice": "bf_emma", "pace": 1.1 }
{ "say": "This one keeps going while it clicks.", "overlap": true }

Only one voice speaks at a time. A script line waits for the one before it. Lines from rolling mark say queue up, however many agents mark at once. And rolling say --at refuses a line that would talk over another, naming the nearest start that fits. Voices beginning with a are American and b British; f is a woman’s voice and m a man’s.

Re-voicing

--revoice, or the studio’s Re-voice button, says every line again in another voice or pace. A line that the one before now runs into waits for it, and moves back to its original time once it fits again.

Captions

Renders mix in the narration and burn in the captions, and write demo.srt and demo.vtt beside the video. Each word is timed by the speech model, then fitted to where its sound actually starts and stops. Idle cuts never cut into narration.

Terminal
rolling render demo --caption-font rounded --caption-weight heavy \
  --caption-size 1.4 --caption-highlight "#ff5ad1" --caption-position top
rolling render demo --caption-font Futura --caption-plate-opacity 0   # outlined words
rolling render demo --no-captions --no-narration                      # leave them out

Any installed font works. Colours are hex. The plate sits behind the words; at opacity 0 the words are outlined instead. The studio’s Captions block has the same controls.

Checking it

rolling sync finds each line in the video’s audio, decoded by AVFoundation and ffmpeg when it is installed, and compares it with the timeline and the subtitle files. It fails if anything is more than 12 ms off.

Terminal
rolling sync demo              # the video's audio against the timeline and subtitles
rolling sync demo --preview    # the studio's player, every caption word as it's heard
rolling sync demo --stills out # a frame from the middle of each caption