87509bcf99
TASKS.md is now the index (status table, open items, research pointer). 33 files: 32 task files + 1 research facts file. The full take-saga narrative and all design decisions are preserved verbatim; the catalog makes the queue readable without opening every task body. Schema and AGENTS.md updated to reflect the new layout.
2.5 KiB
2.5 KiB
TASK 22 — Audio sync offset
Catalog:
TASKS.md— status and requirements live here.
Goal: per-source audio delay compensation to prevent lip-sync drift from USB mics and capture cards.
Status: ✅ Done (shipped TASK 22, 2026-08-31)
- ☑
AudioSyncOffsetMsonMainViewModel(global, default 0, range 0..500 ms) — positive-only: OBS's documented fix delays the audio so it lands on video when it runs ahead; advancing audio would need a video-side delay (out of the audio layer's scope, v1.1+). - ☑ Applied in
AudioMixer— post-mix interleaved-stereo delay via the pureAudioSyncDelayline (Services/Audio/AudioSyncDelay.cs), fed through aFunc<int> syncOffsetMsseam each mix tick. - ☑ UI: compact "SYNC" slider (0..500) on the mic bar with a status dot (green = no-op, amber = offset set) via
IntToSyncBrushConverter. Provenance (recorded 2026-09-01 after a creator "I never ordered this" scare): the creator explicitly asked for OBS's delay-filter lip-sync fix BUILT NATIVELY — the feature is his, not AI drift. Its placement (preview-rail vs mic-settings/gear) remains an open design question; do not remove the capability. - ☑ Persisted in
LayoutStore.Settings(Audio.SyncOffsetMs) viaLoadAudioSyncOffsetMs/SaveAudioSyncOffsetMs; saved fromSaveLayoutNow. - ☑ Tests:
AudioSyncDelayTests— zero-delay identity, negative→0 clamp, >500 ms clamp to 500 ms, and 10 ms → 960 interleaved-sample shift. - ⚠ Post-ship regression (found 2026-09-01, first real launch): this task's sync-delay line
_delayedMixwas declared nullable and never initialized — the firstdelayed.Lengthderef NRE'd EVERY live-mix tick, silently killing all live/record audio, hangingAudioPipelineTests, and being mislabeled a "known failure". Fixed in the recording-verification pass (init + null-check + throttled loop errors logged with stack);AudioPipelineTests25/25 green afterward. Lesson recorded in MyMistakes.
Design decisions
- Global offset first — one setting for all audio sources. Per-source is v1.1+.
- Positive-only (delay audio) — the physically-correct direction (audio runs ahead of the video). True "advance" needs a video-side delay and is PERMANENTLY OUT with per-source sync (TASKS.md → "Out of product" — v1.x phrasing retired 2026-09-01).
- Simple slider — 0 to +500 ms, default 0. No numeric input needed.
- Visual feedback — "sync OK" status dot shows when an offset is dialled in.