feat(windows): per-app screen-audio sharing (include/exclude)
Some checks failed
Build Linux Binaries / linux/amd64 (push) Has been cancelled
Build Linux Binaries / linux/arm64 (push) Has been cancelled

Adds "only selected apps" and "all apps except selected" screen-audio
modes to the Windows client, alongside the existing entire-desktop path.

Per-app capture uses WASAPI process loopback (AUDCLNT_ACTIVATIONTYPE_
PROCESS_LOOPBACK) via ProcessLoopbackCapture, mixed by ProcessAudioMixer
and fed to the core through vc_stream_feed_pcm (external_feed=1 so the
core skips its own loopback device).

Init must pass AUDCLNT_STREAMFLAGS_LOOPBACK | EVENTCALLBACK |
AUTOCONVERTPCM; the LOOPBACK flag is what makes the virtual endpoint
deliver rendered audio (without it every buffer is flagged SILENT) and
AUTOCONVERTPCM resamples the app's native format to 48k s16.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 00:19:38 +02:00
parent 4f89d2d32d
commit e806b698ec
11 changed files with 1064 additions and 24 deletions

View File

@@ -207,6 +207,12 @@ typedef struct vc_stream_desc {
vc_stream_kind kind;
const char* device_id; /* NULL = default device for this kind */
const char* label; /* human label, e.g. "Microphone" */
/* If 1, the caller will feed PCM via vc_stream_feed_pcm; the core will NOT start its own
* WASAPI loopback capture. Only meaningful for VC_STREAM_SCREEN_AUDIO on Windows. Callers
* that brace-initialize this struct (tests, macOS) get 0 = auto-start loopback — no ABI
* break. See clients/windows/VoiceCat.App/Audio/ProcessAudioMixer.cs for the Windows
* per-app capture implementation that sets this. */
int external_feed;
} vc_stream_desc;
/* The effective Opus configuration in use for a stream — for a stream you own, this is