Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

fix(recording): default windows mic to browser processing

wiiiii12345f05e78c419
diff --git a/electron/ipc/recording/windowsFallbacks.test.ts b/electron/ipc/recording/windowsFallbacks.test.ts
index f8586c97..e1c56752 100644
--- a/electron/ipc/recording/windowsFallbacks.test.ts
+++ b/electron/ipc/recording/windowsFallbacks.test.ts
@@ -7,6 +7,12 @@ import {
} from "./windowsFallbacks";
describe("shouldUseWindowsBrowserMicrophoneFallback", () => {
+ it("defaults Windows microphone capture to the browser fallback path", () => {
+ expect(shouldStartWindowsBrowserMicrophoneFallback({ capturesMicrophone: true }, {})).toBe(
+ true,
+ );
+ });
+
it("can be forced before native capture starts", () => {
expect(
shouldStartWindowsBrowserMicrophoneFallback(
@@ -16,6 +22,21 @@ describe("shouldUseWindowsBrowserMicrophoneFallback", () => {
).toBe(true);
});
+ it("allows lab runs to force native WASAPI microphone capture", () => {
+ expect(
+ shouldStartWindowsBrowserMicrophoneFallback(
+ { capturesMicrophone: true },
+ { [WINDOWS_MIC_CAPTURE_MODE_ENV]: "native" },
+ ),
+ ).toBe(false);
+ expect(
+ shouldStartWindowsBrowserMicrophoneFallback(
+ { capturesMicrophone: true },
+ { [WINDOWS_MIC_CAPTURE_MODE_ENV]: "wasapi" },
+ ),
+ ).toBe(false);
+ });
+
it("does not force fallback when microphone capture was not requested", () => {
expect(
shouldStartWindowsBrowserMicrophoneFallback(
@@ -43,6 +64,16 @@ describe("shouldUseWindowsBrowserMicrophoneFallback", () => {
).toBe(false);
});
+ it("returns false for a healthy native mic when lab mode forces native capture", () => {
+ expect(
+ shouldUseWindowsBrowserMicrophoneFallback(
+ "Recording started",
+ { capturesMicrophone: true },
+ { [WINDOWS_MIC_CAPTURE_MODE_ENV]: "native" },
+ ),
+ ).toBe(false);
+ });
+
it("returns true when browser fallback is forced", () => {
expect(
shouldUseWindowsBrowserMicrophoneFallback(
diff --git a/electron/ipc/recording/windowsFallbacks.ts b/electron/ipc/recording/windowsFallbacks.ts
index d758abe7..8a3f581c 100644
--- a/electron/ipc/recording/windowsFallbacks.ts
+++ b/electron/ipc/recording/windowsFallbacks.ts
@@ -10,6 +10,14 @@ export function shouldStartWindowsBrowserMicrophoneFallback(
}
const mode = env[WINDOWS_MIC_CAPTURE_MODE_ENV]?.trim().toLowerCase();
+ if (mode === "native" || mode === "wasapi") {
+ return false;
+ }
+
+ if (!mode) {
+ return true;
+ }
+
return mode === "browser" || mode === "fallback" || mode === "renderer";
}
diff --git a/src/hooks/useScreenRecorder.ts b/src/hooks/useScreenRecorder.ts
index 9a4ef895..6cd4fa04 100644
--- a/src/hooks/useScreenRecorder.ts
+++ b/src/hooks/useScreenRecorder.ts
@@ -1041,7 +1041,7 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
// record mic via browser getUserMedia as a sidecar file.
if (nativeResult.microphoneFallbackRequired && microphoneEnabled) {
void logNativeCaptureDiagnostics("start-browser-microphone-fallback");
- toast.warning("Using browser microphone fallback for this recording.", {
+ toast.warning("Using browser microphone processing for this recording.", {
id: MICROPHONE_FALLBACK_TOAST_ID,
duration: 8000,
});