From bf9ec15912dcfa0cd6360ada09535070d9b17be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=93=D0=BB=D0=B0=D0=B7=D1=83?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Thu, 15 Jan 2026 19:20:34 +0300 Subject: [PATCH] Bump version to 0.5.3 and enhance Windows audio capture using loopback --- package.json | 2 +- src/utils/window.js | 31 ++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 100244b..f6cc443 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cheating-daddy", "productName": "cheating-daddy", - "version": "0.5.2", + "version": "0.5.3", "description": "cheating daddy", "main": "src/index.js", "scripts": { diff --git a/src/utils/window.js b/src/utils/window.js index 1c7f261..6f91383 100644 --- a/src/utils/window.js +++ b/src/utils/window.js @@ -64,15 +64,32 @@ function createWindow(sendToRenderer, geminiSessionRef) { { useSystemPicker: false } // Disable system picker, use our source directly ); } else if (process.platform === 'win32') { - // On Windows, use system picker so user can enable "Share audio" checkbox - // This is REQUIRED for system audio capture on Windows + // On Windows, use desktopCapturer with loopback audio + // This captures system audio via WASAPI without needing user interaction session.defaultSession.setDisplayMediaRequestHandler( - (request, callback) => { - console.log('Windows: Using system picker for screen/audio selection'); - // Don't call callback - let system picker handle it - // The system picker will provide both video and audio if user checks the box + async (request, callback) => { + try { + console.log('Windows: Getting screen sources with loopback audio...'); + const sources = await desktopCapturer.getSources({ + types: ['screen'], + thumbnailSize: { width: 0, height: 0 } + }); + + if (sources.length === 0) { + console.error('No screen sources available on Windows'); + callback(null); + return; + } + + console.log('Windows: Using screen source:', sources[0].name, 'with loopback audio'); + // 'loopback' enables system audio capture via WASAPI on Windows + callback({ video: sources[0], audio: 'loopback' }); + } catch (error) { + console.error('Error getting screen sources on Windows:', error); + callback(null); + } }, - { useSystemPicker: true } + { useSystemPicker: false } ); } else { // On Linux, try to get system audio via loopback