What to build
The foundational tracer bullet for Windows audio capture: record the microphone end-to-end into openable, rotating .m4a segments, decoupled from screen capture.
This slice establishes the shared audio seam that the system-audio and inactivity slices build on:
- Introduce a platform-neutral
AudioCaptureSession trait (rotate→finalization, stop, is_live, take_stop_error), mirroring ScreenCaptureSession. The Recording Lifecycle holds active_microphone_session and active_system_audio_session as Box<dyn AudioCaptureSession>. macOS microphone keeps its concrete type for now; the trait's finalization type must reconcile with the existing macOS finalization consumed by microphone output finalization.
- WASAPI default-device microphone input → AAC
.m4a via Media Foundation (AAC encoder + MPEG-4/M4A sink in the writers crate). Mirrors the macOS separate-audio layout — zero schema churn.
- Reuse the existing
SegmentPlanner layout verbatim: <save_root>/YYYY/MM/DD/audio/<session_id>-segment-####.m4a, microphone via a mic_session-prefixed id. Populate SourceSessions.microphone source-session metadata (currently never populated on Windows).
- Segment rotation on the 5-minute Capture Segment Duration boundary, driven by the existing source-independent wall-clock
CaptureClock + SegmentSchedule — no new timing source. Add the Windows microphone rotate arm to the rotation tick.
- Audio-only restructure: the rotation tick must not hard-require a screen planner/session. The "no screen planner ⇒ fail session" guard and the screen-capture-stopped failure check become conditional on whether screen is an active source (a no-op for macOS, which always has a screen planner when audio is active). No per-segment screen workspace dir is created for audio-only sessions.
- Finalization validation: define "openable
.m4a" as "Media Foundation Source Reader opens it and MF_PD_DURATION > 0", reusing the existing injectable has_positive_duration validator seam (un-gate the structural helpers to also build on Windows; only the MF probe leaf is new). Matches the macOS audio contract.
- Commit produced Audio Segments, but do not enqueue audio processing jobs on Windows yet (capture-and-store now; a future audio-decode slice will backfill them). Non-goal: audio decode-to-PCM.
- Flip
supported_sources.microphone on for Windows so the source becomes user-selectable.
The Windows user pause/resume control stays hidden until the inactivity slice fixes resume (see slice 3c).
Non-goals (explicitly out): audio decode-to-PCM for transcription/speaker/speech-activity, frame-index sidecars, exact/scrub previews, microphone device-change handling (slice 1b), permission UX (slice 1c), VAD/activity emission (slice 1d).
Acceptance criteria
Blocked by
What to build
The foundational tracer bullet for Windows audio capture: record the microphone end-to-end into openable, rotating
.m4asegments, decoupled from screen capture.This slice establishes the shared audio seam that the system-audio and inactivity slices build on:
AudioCaptureSessiontrait (rotate→finalization, stop, is_live, take_stop_error), mirroringScreenCaptureSession. The Recording Lifecycle holdsactive_microphone_sessionandactive_system_audio_sessionasBox<dyn AudioCaptureSession>. macOS microphone keeps its concrete type for now; the trait's finalization type must reconcile with the existing macOS finalization consumed by microphone output finalization..m4avia Media Foundation (AAC encoder + MPEG-4/M4A sink in the writers crate). Mirrors the macOS separate-audio layout — zero schema churn.SegmentPlannerlayout verbatim:<save_root>/YYYY/MM/DD/audio/<session_id>-segment-####.m4a, microphone via amic_session-prefixed id. PopulateSourceSessions.microphonesource-session metadata (currently never populated on Windows).CaptureClock+SegmentSchedule— no new timing source. Add the Windows microphone rotate arm to the rotation tick..m4a" as "Media Foundation Source Reader opens it andMF_PD_DURATION> 0", reusing the existing injectablehas_positive_durationvalidator seam (un-gate the structural helpers to also build on Windows; only the MF probe leaf is new). Matches the macOS audio contract.supported_sources.microphoneon for Windows so the source becomes user-selectable.The Windows user pause/resume control stays hidden until the inactivity slice fixes resume (see slice 3c).
Non-goals (explicitly out): audio decode-to-PCM for transcription/speaker/speech-activity, frame-index sidecars, exact/scrub previews, microphone device-change handling (slice 1b), permission UX (slice 1c), VAD/activity emission (slice 1d).
Acceptance criteria
AudioCaptureSessiontrait exists; runtime holds microphone (and system-audio) sessions asBox<dyn AudioCaptureSession>; macOS finalization reconciled.m4asegments under the sharedaudio/dir withmic_session-prefixed idsSourceSessions.microphonemetadata is populated on WindowsCaptureClock/SegmentSchedule; no screen session is required.m4afinalization validated via MF Source Reader positive-duration probe through the existing injectable validator seamsupported_sources.microphoneis true on Windows and reveals the mic source in the UIBlocked by