fix(recording): declip native Windows mic peaks

This commit is contained in:
wiiiii123
2026-05-06 19:10:22 +07:00
parent f8df2d6ae9
commit ae0378cee4
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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]",
]);
});
});
+3 -3
View File
@@ -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<boolean> {