feat: add WASAPI loopback capture mixed with microphone (Windows)#1259
Open
MoulinLouis wants to merge 1 commit intocjpais:mainfrom
Open
feat: add WASAPI loopback capture mixed with microphone (Windows)#1259MoulinLouis wants to merge 1 commit intocjpais:mainfrom
MoulinLouis wants to merge 1 commit intocjpais:mainfrom
Conversation
Add a "Record System Audio" toggle (Windows only) that captures WASAPI loopback audio from the selected output device and mixes it with the microphone input before transcription. Both streams are resampled to 16kHz independently and mixed sample- by-sample before VAD processing, so speech from either source is captured. Mute-while-recording is skipped when loopback is active since muting the output device would silence the capture source. Backend: - New record_system_audio bool setting with get/set Tauri commands - AudioRecorder.open() accepts optional loopback_device for mixing - run_consumer() handles dual-stream resampling and mixing - AudioRecordingManager always opens mic, optionally adds loopback - set_selected_output_device restarts stream when loopback active - Mute skipped in loopback mode, audio feedback still plays Frontend: - RecordSystemAudio toggle component (Windows only) - Settings store updater and normalization - MuteWhileRecording disabled when loopback active - Output device selector stays enabled for loopback source selection - i18n keys for the new toggle
Owner
|
Can you send screenshots, I'm open to this as a lot of people ask and if it's well implemented we can pull it in. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Before Submitting This PR
Human Written Description
I do a lot of technical interviews over Google Meet and I've been wanting to transcribe both sides of the conversation, not just my mic. Right now I have to use a separate app for that and it's annoying. Since cpal already supports WASAPI loopback natively, I figured I'd try adding it to Handy.
I saw #248 and @cjpais's response about being open to a well-written PR. I also know about the feature freeze, so totally fine if this gets rejected.
I tried to keep it as non-intrusive as possible:
Related Issues/Discussions
Related to #248, same feature request but with a mic+loopback mixing approach instead of switching between sources.
Community Feedback
A few people asked for this in #248 for similar use cases (transcribing meetings, calls, etc). It's definitely a niche feature though, which is why I kept it as a simple opt-in toggle.
Testing
Changes overview
Backend (Rust):
settings.rs: newrecord_system_audio: boolfieldrecorder.rs:open()accepts optional loopback device,run_consumer()resamples both streams to 16kHz and mixes them before VADaudio.rs: always resolves mic device, optionally resolves output device for loopbackcommands/audio.rs:set_record_system_audio/get_record_system_audiocommandsactions.rs: mute skipped when loopback active (output device is the capture source)Frontend (React/TypeScript):
RecordSystemAudio.tsx: toggle component following existing patternsGeneralSettings.tsx: toggle at bottom of Sound section, MuteWhileRecording disabled when activesettingsStore.ts: updater and normalizationScreenshots/Videos (if applicable)
N/A, simple toggle in existing Sound settings section
AI Assistance
If AI was used: