# CODEGRAPH ## Project - Product: Wails v3 / Go desktop dictation app. - Current branch purpose: Windows technical preview based on `v2.1.38-build20260629.2014-diagnostic`. - Protected macOS behavior: existing macOS App Store / local DMG build lines are not changed by this branch. ## Core Entrypoints - `privatevoice.src/main.go`: process startup, data migration, logger, single-instance guard. - `privatevoice.src/app.go`: Wails app wiring, settings window, tray, recorder, hotkey loop, ASR init, paste orchestration. - `privatevoice.src/embed.go`: embeds frontend assets and app/tray icons. ## Platform Modules - Audio: `privatevoice.src/internal/audio/recorder.go` - Uses `github.com/gen2brain/malgo`. - Cross-platform capture target: 16 kHz, 16-bit, mono. - Hotkey: - macOS: `privatevoice.src/internal/hotkey/hotkey_darwin.go` - Windows: `privatevoice.src/internal/hotkey/hotkey_windows.go` - Text input: - macOS: `privatevoice.src/internal/input/paste_darwin.go` - Windows: `privatevoice.src/internal/input/paste_windows.go` - ASR engine: - macOS: `privatevoice.src/internal/engine/engine_darwin.go` - Windows: `privatevoice.src/internal/engine/engine_windows.go` - Overlay: - macOS: `privatevoice.src/internal/overlay/overlay_darwin.go` - Windows: `privatevoice.src/internal/overlay/overlay_windows.go` ## Windows Preview Scope - Windows preview supports `SenseVoice` only. - Non-SenseVoice models remain visible in settings but are disabled through `model.IsModelSupportedInCurrentBuild`. - Windows unsupported reason: `windows_preview_unsupported`. - Build script: `privatevoice.src/scripts/build-windows-preview.sh`. - Runtime package includes: - `PrivateVoice Dictation.exe` - `onnxruntime.dll` - `sherpa-onnx-c-api.dll` - `sherpa-onnx-cxx-api.dll` - `QA-WINDOWS-PREVIEW.ps1` - `README-WINDOWS-PREVIEW.txt` ## Standard Verification Commands Run from `privatevoice.src`: ```bash npm --prefix frontend run build go test ./... GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go test -exec=/usr/bin/true ./... ./scripts/build-windows-preview.sh ``` ## Known Gaps - Windows runtime QA must still be performed on Windows 10/11 hardware. - Run `QA-WINDOWS-PREVIEW.ps1` from the extracted preview package to collect startup, engine, recording, recognition, paste, and Notepad target text evidence. - The Windows preview zip is unsigned and not an installer. - SmartScreen / Defender prompts are expected for local testing.