Skip to content

feat: export the timeline as a video with sound - #83

Open
tcsenpai wants to merge 3 commits into
patoles:mainfrom
tcsenpai:feat/timeline-export
Open

tcsenpai wants to merge 3 commits into
patoles:mainfrom
tcsenpai:feat/timeline-export

Conversation

@tcsenpai

@tcsenpai tcsenpai commented Sep 9, 2026

Copy link
Copy Markdown

Adds an Export button to the top bar that records the whole timeline as a video file, sounds included.

How it works: the simulation is rewound to t=0 and replayed at the current speed while a MediaRecorder captures canvas.captureStream() plus the AudioEngine's output; the result is downloaded when playback reaches the last event. MP4 (H.264/AAC) where the browser can encode it (Safari, recent Chrome), WebM/VP9+Opus otherwise. Click again to cancel.

  • Idle stretches longer than 10s of sim time are replaced by a 2s caption card (… 3m 20s later …) drawn into the canvas itself, so it ends up in the recording, then the clock skips to the next event via a new skipTo() that only moves time across an event-free stretch.
  • Sounds are recorded even when muted: mute moved to a separate output stage and the recorder taps the mix before it. Review-mode audio gating is bypassed while exporting.
  • No new dependencies. GIF is not included: it cannot carry audio, and a client-side GIF encoder would be a new dependency; happy to add it as a silent option if wanted.

https://claude.ai/code/session_01AGs5TZo6yxv7NHARHawyJf

Export button in the top bar replays the whole timeline from t=0 at the
current speed while a MediaRecorder captures canvas.captureStream() plus the
AudioEngine output, then downloads the file. MP4 (H.264/AAC) where the
browser can encode it, WebM otherwise.

- Idle stretches longer than 10s of sim time are replaced by a 2s caption
  card ('… 3m 20s later …') drawn into the canvas, then the clock skips to
  the next event (new skipTo() on the simulation).
- Sounds are recorded even when the speakers are muted: mute now sits on a
  separate output stage and the recorder taps the mix before it.
- Review-mode audio gating is bypassed during an export.
- Click the button again to cancel (nothing is saved).

https://claude.ai/code/session_01AGs5TZo6yxv7NHARHawyJf
@cla-assistant

cla-assistant Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant