Skip to content

feat: Windows support — WASAPI system audio loopback capture#1

Open
stjiao14 wants to merge 6 commits into
sufforest:mainfrom
stjiao14:feat/windows-support
Open

feat: Windows support — WASAPI system audio loopback capture#1
stjiao14 wants to merge 6 commits into
sufforest:mainfrom
stjiao14:feat/windows-support

Conversation

@stjiao14

Copy link
Copy Markdown

What

This PR adds Windows support to Aura by implementing system audio loopback capture via WASAPI, mirroring the existing macOS ScreenCaptureKit backend.

Changes

File Change
src-tauri/Cargo.toml Add windows crate (WASAPI Win32 APIs) under cfg(windows)
src-tauri/src/audio/loopback_windows.rs New — WASAPI loopback backend: opens default render endpoint with AUDCLNT_STREAMFLAGS_LOOPBACK, polls GetBuffer in a background thread, converts PCM→f32
src-tauri/src/audio/mod.rs Route loopback module via #[path]: loopback.rs on macOS, loopback_windows.rs on Windows
src-tauri/src/audio/mic.rs Add no-op ensure_mic_permission() for non-macOS — WASAPI prompts automatically
src-tauri/src/calendar/mod.rs Add no-op list_upcoming_events() for non-macOS
src-tauri/tauri.conf.json Add nsis bundle target for Windows installer

How it works

WASAPI loopback taps the default render device — no special permission needed. A background thread calls GetBuffer every 10 ms, converts the device’s native PCM (f32 or i16) to f32, and stores it in a Mutex<Vec<f32>> consumed by drain()/stop().

Testing

cargo build                    # Windows, requires CMake for whisper-rs
cargo build --no-default-features  # skip whisper, faster CI
cargo test                     # unit tests pass cross-platform

Live: start any meeting (Zoom, Teams, Meet), click Record, verify transcript.

Updated microphone capture documentation and added platform-specific permission handling for macOS. Enhanced the mic stream setup process to ensure permissions are granted before opening the stream.
… loopback module to WASAPI backend on Windows
Implement system audio loopback capture on Windows using WASAPI. Provides public API methods to start, drain, and stop audio capture.
Implement macOS calendar event fetching using EventKit and add tests for CalendarEvent serialization.
@stjiao14

Copy link
Copy Markdown
Author

@sufforest PTAL

Comment thread src-tauri/tauri.conf.json
"nsis": {}
}
}
}{

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file is malformed

out[i] += s * 0.6;
}
out
}//! Audio capture pipeline — mic (cpal) + system loopback (ScreenCaptureKit).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff prepended new code to the old file

Comment thread src-tauri/Cargo.toml

# Windows: WASAPI for system audio loopback
[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.58", features = [

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No windows CI job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants