From 012cdaf5f330d9c0c868a983031ff068659360ac Mon Sep 17 00:00:00 2001 From: egg Date: Wed, 17 Dec 2025 18:18:48 +0800 Subject: [PATCH] fix: Add Chromium flags to fix audio capture in Electron MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Disable AudioServiceOutOfProcess feature which can cause audio capture issues - Enable WebRTCPipeWireCapturer for better audio support - Set autoplay-policy to no-user-gesture-required These flags must be set before app is ready and help resolve "Could not start audio source" errors in Electron while the same microphone works fine in regular browsers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- client/src/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/main.js b/client/src/main.js index cda103f..7c61708 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -4,6 +4,12 @@ const fs = require("fs"); const { spawn } = require("child_process"); const os = require("os"); +// Chromium flags to fix audio capture issues in Electron +// Must be set before app is ready +app.commandLine.appendSwitch("disable-features", "AudioServiceOutOfProcess"); +app.commandLine.appendSwitch("enable-features", "WebRTCPipeWireCapturer"); +app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required"); + let mainWindow; let sidecarProcess; let sidecarReady = false;