From c433db07b7324fb7a327fa3dc600117f16852346 Mon Sep 17 00:00:00 2001 From: rishikanthc Date: Thu, 25 Dec 2025 18:03:05 -0800 Subject: [PATCH] feat: add toggle for Automatic Gain Control Allow users to enable/disable AGC before starting recording. AGC automatically adjusts microphone volume for consistent levels. --- .../src/components/SystemAudioRecorder.tsx | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/web/frontend/src/components/SystemAudioRecorder.tsx b/web/frontend/src/components/SystemAudioRecorder.tsx index 2705a364..3ea692c5 100644 --- a/web/frontend/src/components/SystemAudioRecorder.tsx +++ b/web/frontend/src/components/SystemAudioRecorder.tsx @@ -27,6 +27,7 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Slider } from "@/components/ui/slider"; +import { Switch } from "@/components/ui/switch"; import { useToast } from "@/components/ui/toast"; interface SystemAudioRecorderProps { @@ -65,6 +66,9 @@ export function SystemAudioRecorder({ const [availableDevices, setAvailableDevices] = useState([]); const [selectedDevice, setSelectedDevice] = useState(""); + // Audio Settings + const [autoGainControl, setAutoGainControl] = useState(true); + // Error & Compatibility const [compatibilityError, setCompatibilityError] = useState(null); const [permissionDenied, setPermissionDenied] = useState(false); @@ -315,7 +319,7 @@ export function SystemAudioRecorder({ // @ts-expect-error - Chrome/Edge support "remote-only" for echo cancellation echoCancellation: "remote-only", // Only cancel remote echo, allow mic during local playback noiseSuppression: true, // Remove background noise - autoGainControl: true, // Normalize volume levels + autoGainControl: autoGainControl, // Normalize volume levels (user configurable) }, }); @@ -849,6 +853,28 @@ export function SystemAudioRecorder({ )} + {/* Audio Settings */} +
+ +
+
+
+ Automatic Gain Control +
+

+ Automatically adjusts microphone volume for consistent audio levels +

+
+ +
+
+ {/* Start Button */}