fix(desktop): capture screen share audio from chosen devices (#3456)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-14 02:48:19 +02:00
1 parent 123c4d5bbf
commit 97b2ac91ca
56 files changed
+2338 -291

No files matched your search

@@ -121,6 +121,11 @@ function pidFromHwnd(hwnd) {
}
}
function listPlaybackDevices() {
if (!binding) return Promise.resolve([]);
return binding.listPlaybackDevices();
}
function resolveAudioRootPid(pid) {
if (!binding) return pid;
try {
@@ -148,7 +153,7 @@ class ProcessLoopback extends EventEmitter {
this._rejectStart = null;
this._native = new binding.ProcessLoopback(
pid,
{includeProcessTree, sampleRate, channels, captureScope},
{includeProcessTree, sampleRate, channels, captureScope, endpoints: opts.endpoints},
(frame) => this.emit('frame', frame),
(err) => {
if (!this._started && this._rejectStart) {
@@ -204,6 +209,10 @@ class ProcessLoopback extends EventEmitter {
return this._startPromise;
}
setEndpoints(endpoints) {
return this._stopped ? false : this._native.setEndpoints(endpoints);
}
stop() {
if (this._stopped) return;
this._stopped = true;
@@ -220,6 +229,7 @@ module.exports = {
getBackendInfo,
pidFromHwnd,
resolveAudioRootPid,
listPlaybackDevices,
ProcessLoopback,
get loadError() {
return loadError;