diff --git a/electron/ipc/ffmpeg/filters.test.ts b/electron/ipc/ffmpeg/filters.test.ts index 9660fd29..8b8ecfdb 100644 --- a/electron/ipc/ffmpeg/filters.test.ts +++ b/electron/ipc/ffmpeg/filters.test.ts @@ -116,11 +116,11 @@ describe("getAudioSyncAdjustment", () => { it("can prepend mic normalization filters before sync handling", () => { const filterParts: string[] = []; appendSyncedAudioFilter(filterParts, "[1:a]", "aout", getAudioSyncAdjustment(120, 120), { - preFilters: ["loudnorm=I=-16:TP=-1.5:LRA=11"], + preFilters: ["adeclip=threshold=1", "loudnorm=I=-16:TP=-1.5:LRA=11"], }); expect(filterParts).toEqual([ - "[1:a]loudnorm=I=-16:TP=-1.5:LRA=11,aresample=async=1:first_pts=0,asetpts=PTS-STARTPTS[aout]", + "[1:a]adeclip=threshold=1,loudnorm=I=-16:TP=-1.5:LRA=11,aresample=async=1:first_pts=0,asetpts=PTS-STARTPTS[aout]", ]); }); }); diff --git a/electron/ipc/recording/windows.ts b/electron/ipc/recording/windows.ts index 9c944028..63d4e24f 100644 --- a/electron/ipc/recording/windows.ts +++ b/electron/ipc/recording/windows.ts @@ -32,9 +32,9 @@ import { import { emitRecordingInterrupted } from "./events"; const execFileAsync = promisify(execFile); -// Match the browser path's "usable speech level" intent with a standard -// loudness pass on native Windows mic audio instead of a fixed tiny boost. -const WINDOWS_NATIVE_MIC_PRE_FILTERS = ["loudnorm=I=-16:TP=-1.5:LRA=11"]; +// Repair rare clipped mic peaks before loudness normalization so headset/driver +// overloads do not get amplified into audible pops during mux/export. +const WINDOWS_NATIVE_MIC_PRE_FILTERS = ["adeclip=threshold=1", "loudnorm=I=-16:TP=-1.5:LRA=11"]; const MIN_NATIVE_WINDOWS_VIDEO_PAD_MS = 500; export async function isNativeWindowsCaptureAvailable(): Promise {