From 5828023651f670636fbcb12376c6ed5950e0d4e3 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Mon, 6 Jul 2026 16:26:27 -0500 Subject: [PATCH] docs: FR-CAP-7 microphone capture + mixer contract --- docs/01-requirements.md | 1 + docs/02-architecture.md | 2 +- docs/04-api-contracts.md | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/01-requirements.md b/docs/01-requirements.md index f76689c..0965f71 100644 --- a/docs/01-requirements.md +++ b/docs/01-requirements.md @@ -16,6 +16,7 @@ Each requirement has a stable ID used across the roadmap, tests, and commits. Pr | FR-CAP-4 | M | 1 | Show an unambiguous "recording active" indicator (in-app banner + tray icon). | | FR-CAP-5 | S | 7 | Render a live input waveform / level meter while recording. | | FR-CAP-6 | S | 7 | Handle audio device changes mid-recording without losing the session. | +| FR-CAP-7 | S | 1 | Optionally capture the user's **microphone** alongside loopback and mix it into the live transcript (default ON, local-only/no egress, selectable device + "off"). | ### Recording retention & consent (REC) — see ADR-0009 diff --git a/docs/02-architecture.md b/docs/02-architecture.md index 7f02839..10cf293 100644 --- a/docs/02-architecture.md +++ b/docs/02-architecture.md @@ -55,7 +55,7 @@ touches files, DB, or network directly — only Tauri commands/events (`04-api-c | Service | Responsibility | Primary crate(s) | |---|---|---| -| `audio` | WASAPI loopback capture; PCM ring buffer; write WAV to disk; pause/resume | `wasapi`, `hound` | +| `audio` | WASAPI loopback capture (+ optional microphone, mixed into the transcript stream, FR-CAP-7); PCM ring buffer; write WAV to disk; pause/resume | `wasapi`, `hound` | | `hardware` | Enumerate NPU/GPU/CPU; rank backends; report capabilities | `ort`, DXGI via `windows` | | `transcription` | Load model on a backend; stream segments (whisper.cpp) or NPU (ONNX) | `whisper-rs`, `ort` | | `diarization` | Post-process audio → speaker spans; align to segments; merge | `sherpa-onnx` (FFI) | diff --git a/docs/04-api-contracts.md b/docs/04-api-contracts.md index a3de873..0f1f25f 100644 --- a/docs/04-api-contracts.md +++ b/docs/04-api-contracts.md @@ -154,10 +154,15 @@ indicative (async where I/O-bound). pub trait AudioCapture: Send + Sync { /// Begin WASAPI loopback capture, writing PCM to `wav_path`; frames also pushed to `sink`. fn start(&self, wav_path: &Path, sink: FrameSink) -> Result; + /// Capture the user's microphone (FR-CAP-7); frames pushed to `sink`, no WAV. + fn start_microphone(&self, device_id: Option<&str>, sink: FrameSink) -> Result; fn pause(&self, h: &CaptureHandle) -> Result<(), AudioError>; fn resume(&self, h: &CaptureHandle) -> Result<(), AudioError>; fn stop(&self, h: CaptureHandle) -> Result; } +// When the mic is enabled, `spawn_mixer` sums the loopback + mic 16kHz-mono +// frames into the single transcription stream (`list_input_devices` enumerates +// mic devices, mirroring `list_audio_devices` for render devices). // hardware/mod.rs pub trait HardwareDetector: Send + Sync {