Skip to content

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

fix(recording): preserve mic audio when recovering mac capture

Azeem Tariq6c6aca0fed78
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts
index 0b030be7..9957465c 100644
--- a/electron/ipc/handlers.ts
+++ b/electron/ipc/handlers.ts
@@ -2651,25 +2651,32 @@ async function finalizeStoredVideo(videoPath: string) {
}
async function recoverNativeMacCaptureOutput() {
- const diagnosticsPath =
+ const macDiagnostics =
lastNativeCaptureDiagnostics?.backend === 'mac-screencapturekit'
- ? lastNativeCaptureDiagnostics.outputPath ?? null
+ ? lastNativeCaptureDiagnostics
: null
+ const diagnosticsPath = macDiagnostics?.outputPath ?? null
const candidatePath = nativeCaptureTargetPath ?? diagnosticsPath
+ const systemAudioPath = nativeCaptureSystemAudioPath ?? macDiagnostics?.systemAudioPath ?? null
+ const microphonePath = nativeCaptureMicrophonePath ?? macDiagnostics?.microphonePath ?? null
if (!candidatePath) {
return null
}
try {
+ if (systemAudioPath || microphonePath) {
+ await muxNativeMacRecordingWithAudio(candidatePath, systemAudioPath, microphonePath)
+ }
+
return await finalizeStoredVideo(candidatePath)
} catch (error) {
recordNativeCaptureDiagnostics({
backend: 'mac-screencapturekit',
phase: 'stop',
outputPath: candidatePath,
- systemAudioPath: nativeCaptureSystemAudioPath,
- microphonePath: nativeCaptureMicrophonePath,
+ systemAudioPath,
+ microphonePath,
processOutput: nativeCaptureOutputBuffer.trim() || undefined,
fileSizeBytes: await getFileSizeIfPresent(candidatePath),
error: String(error),
@@ -4899,4 +4906,3 @@ body{background:transparent;overflow:hidden;width:100vw;height:100vh}
}
})
}
-