Skip to content

Media and TTS

Story can drive local video playback and speech-backed narration without leaving the same action script model used by simpler samples.

Video sprites point at local assets

samples/story/video-demo.story.yaml creates a video sprite from a checked-in MP4:

yaml
- create@clip:
    video: assets/flower.mp4
    time: 0s
    width: 960
    height: 540
    x: 640
    y: 396
    align: center
    radius: 24
    opacity: 0

The sprite starts at time: 0s, then later actions move its source time forward.

playback drives deterministic video time

The same sample uses playback instead of ad-hoc timers:

yaml
- playback@bloom: $clip
  to: 5s
  muted: true

- set:
    progress.width: 960
  with:
    tween: 5s
    easing: 0, 0, 1, 1

- wait: done

playback@bloom is the completion source for the video drive, while the separate tween keeps the progress bar visually aligned with the same duration.

speak adds narration to the same timeline

samples/story/tts-demo.story.yaml uses a voice token and named speech actions:

yaml
tokens:
  - alias@narrator: !voice $default

- speak@intro: "Welcome to the Rune Story text to speech demo."
  voice: $narrator

That keeps the narration configurable while the rest of the Story stays declarative.

Speech can drive later actions

The TTS sample also uses speech as a timing source:

yaml
- set:
    meter.width: 560
    title.color: "#58a6ff"
  with:
    tween: $intro

- wait: $intro.drive
- wait: speak

This is useful when visuals must stay synchronized with spoken labels instead of a guessed fixed duration.

List voices and choose providers with the CLI

The generated CLI reference exposes the voice and provider options used by the checked-in sample:

powershell
story voices --locale en-US
story preview samples/story/tts-demo.story.yaml
story preview samples/story/tts-demo.story.yaml --tts-provider azure
story export samples/story/tts-demo.story.yaml --tts-provider azure

story voices lists Azure voice short names for a locale. --tts-provider azure switches preview or export to the Azure provider instead of the host default.

Azure AI Speech wiring stays outside YAML

tts-demo.story.yaml documents the required environment variables directly in the file header:

powershell
$env:AZURE_SPEECH_KEY = "<your-key>"
$env:AZURE_SPEECH_REGION = "eastus2"

Keep those values in environment variables, not in the Story file.

Preview the media samples

powershell
story preview samples/story/video-demo.story.yaml
story preview samples/story/tts-demo.story.yaml

Use Preview, live, and export when you want the rest of the delivery workflow.

Rune Project brings Rune Story authoring together with the Rune Engine rendering foundation.