3.7 KiB
HANDOFF — session state
Current operational state, read right after
TASKS.md. Trust this file as the truth of what is in flight — do not re-derive from git/fs unless it points at a problem. Conventions:schema.md. Rewrite this file at session end, compaction, or any interruption.
Session state (last updated: 2026-08-12)
-
Branch:
main. TASK 4 ship step 4 (WASAPI audio capture) is built and tested but NOT committed — the working tree is dirty with the audio layer (6 new files inServices/Audio/+ytLive.Tests/AudioMixerTests.cs, theNAudio.Wasapi2.2.1 package reference, the THIRD-PARTY-NOTICES entry, theMainViewModelwiring, theFfmpegEncoder.cs:139CS8602 fix) and its memory updates (TASKS.md, ai.md, Services/index.md, HANDOFF.md). Ready to commit when the user says so. -
Finished this session: TASK 4 ship step 4 — the live audio capture layer:
IAudioSource/AudioSampleseam,WasapiLoopbackAudioSource(WasapiLoopbackCaptureon the default render device),WasapiMicAudioSource(WasapiCapture, NAudio device resolved byFriendlyNamematchingMicSourceNamevia a re-readFunc<string?>provider, default-endpoint fallback),AudioMixer(owns both sources, starts/stops with go-live, feeds the pureAudioLevelMeter→MicLevelChanged),WaveToFloat(IEEE-float / PCM16 / extensible).MainViewModelconstructs the mixer,BeginGoLivesuccess →Start(),StopStream→Stop(),MicLevelChangedmarshalled to the UI thread →AudioLevel. Loopback samples are currently dropped (the encoder's AAC mix, ship step 5, consumes them). Build: 0 warnings (a pre-existing CS8602 inFfmpegEncoder.cs:139surfaced during the rebuild and was fixed withprocess!). Tests: 139 passing (was 122; +17 new audio). -
Landmines:
WaveFormatExtensible.SubFormatis aGuidin NAudio 2.x, not aWaveFormatEncoding— compare it toNAudio.Dmo.AudioMediaSubtypes.MEDIASUBTYPE_IEEE_FLOAT(the IEEE-float subtype constant; it lives in theNAudio.Dmonamespace, not CoreAudioApi).- Use the
NAudio.Wasapi2.2.1 feature package, not theNAudiometa-package — the wasapi types come from that package (WasapiCaptureinNAudio.CoreAudioApi,WasapiLoopbackCaptureinNAudio.Wave);NAudio.Corecomes in transitively. - The audio meter is an exponential smoother (0.2 factor) — a single pushed sample only moves 20% toward its RMS. Tests must push repeatedly before asserting a converged level.
- Tests never instantiate
MainViewModeldirectly except the round-clip integration test (a realMainWindow), which never goes live — so the mixer is constructed but never started there; NAudio types are only constructed, never touching devices. Keep it that way. - Mic device resolution must re-read
MicSourceNameat eachStart(the app persists only the DisplayName, not a device ID). - Windows-only: all capture runs only while live (privacy indicator otherwise).
-
Next step: TASK 4 ship step 5 — the frame-pipeline wiring (
CameraManager/ScreenCaptureManager→ compositor resolver → encoder construction, plus the loopback → encoder AAC mix). Nothing else queued — do not expand the task queue on your own. -
Secret/DB/port facts live: OAuth client id/secret in
Helpers/OAuthCredentials.cs; OAuth session token inHelpers/TokenStore.cs(DPAPI →%APPDATA%\ytLlive\ytLlive.auth); layout DB%APPDATA%\ytLlive\ytLlive.db(schema v8;SocialEntry.Softwarecolumn is a column-presence migration like the others, no version bump); OAuth callbackhttp://localhost:8765/oauth2/callback; crash log%APPDATA%\ytLlive\startup.log.