Commit 9ca7644
authored
feat(studio): play the scenario's audio while previewing (#182)
The studio had no audio output at all — no backend in its dependencies, no
stream anywhere, Present mode included. Judging a cut without sound is half
the job, so the transport now plays.
What it plays is the output of mix_audio_tracks, the same function the encoder
calls, so start/end, fades, per-track volume and volume keyframes are heard
exactly as they will be muxed. A preview that ignored the envelope would
misreport the edit.
The mix spans the whole scenario, silence included, which lets the playhead
follow the audio clock instead of a 1/fps timer that drifts against the sound
card over a long scenario. With no track — or no output device, as in CI — the
timer stays in charge and nothing changes.
cpal's stream is not Send, so it runs on its own thread behind a command
channel; position and state are published as atomics the UI reads without
touching it. Seeking publishes the new position on the caller's side so a
scrub cannot read back as the old one and snap the playhead backwards.
Play/pause, scrub and a mute button drive it; the mix is rebuilt whenever the
model reloads, so opening another file does not keep the previous sound.1 parent da98916 commit 9ca7644
6 files changed
Lines changed: 481 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
0 commit comments