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:
- create@clip:
video: assets/flower.mp4
time: 0s
width: 960
height: 540
x: 640
y: 396
align: center
radius: 24
opacity: 0The 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:
- playback@bloom: $clip
to: 5s
muted: true
- set:
progress.width: 960
with:
tween: 5s
easing: 0, 0, 1, 1
- wait: doneplayback@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:
tokens:
- alias@narrator: !voice $default
- speak@intro: "Welcome to the Rune Story text to speech demo."
voice: $narratorThat 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:
- set:
meter.width: 560
title.color: "#58a6ff"
with:
tween: $intro
- wait: $intro.drive
- wait: speakThis 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:
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 azurestory 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:
$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
story preview samples/story/video-demo.story.yaml
story preview samples/story/tts-demo.story.yamlUse Preview, live, and export when you want the rest of the delivery workflow.