fix: Windows audio mute fix

This commit is contained in:
2026-04-16 19:07:44 +02:00
parent f3b56fb1cc
commit b4ac0cdc92
2 changed files with 46 additions and 3 deletions

View File

@@ -49,9 +49,19 @@ export class DesktopElectronScreenShareCapture {
const sources = await electronApi.getSources();
const selection = await this.resolveSourceSelection(sources, options.includeSystemAudio);
// On Windows, electron-desktop loopback audio captures all system output
// including the app's voice playback, creating echo for watchers or
// requiring total voice muting for the sharer. The getDisplayMedia path
// handles this correctly via restrictOwnAudio — if we fell back here,
// share video only so voice chat stays functional.
const effectiveIncludeSystemAudio = this.isWindowsElectron()
? false
: selection.includeSystemAudio;
const captureOptions = {
...options,
includeSystemAudio: selection.includeSystemAudio
includeSystemAudio: effectiveIncludeSystemAudio
};
if (!selection.source) {
@@ -59,7 +69,7 @@ export class DesktopElectronScreenShareCapture {
}
this.logger.info('Selected Electron desktop source', {
includeSystemAudio: selection.includeSystemAudio,
includeSystemAudio: effectiveIncludeSystemAudio,
sourceId: selection.source.id,
sourceName: selection.source.name
});
@@ -73,7 +83,7 @@ export class DesktopElectronScreenShareCapture {
}
return {
includeSystemAudio: selection.includeSystemAudio,
includeSystemAudio: effectiveIncludeSystemAudio,
stream: await navigator.mediaDevices.getUserMedia(constraints)
};
}