Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix(macos): keep a window take going when its audio stream cannot be set up
Etienne Lescoteb01b8f3cde6
diff --git a/electron/native/screencapturekit/Sources/OpenScreenScreenCaptureKitHelper/ScreenCaptureRecorder.swift b/electron/native/screencapturekit/Sources/OpenScreenScreenCaptureKitHelper/ScreenCaptureRecorder.swiftindex ebac486ee..1450f130d 100644--- a/electron/native/screencapturekit/Sources/OpenScreenScreenCaptureKitHelper/ScreenCaptureRecorder.swift+++ b/electron/native/screencapturekit/Sources/OpenScreenScreenCaptureKitHelper/ScreenCaptureRecorder.swift@@ -222,8 +222,18 @@ final class ScreenCaptureRecorder: NSObject, SCStreamOutput, SCStreamDelegate {target = try makeCaptureTarget(from: content)if recordsSystemAudioFromDisplay, let display = content.displays.first {let filter = SCContentFilter(display: display, excludingApplications: [], exceptingWindows: [])- audioStream = SCStream(filter: filter, configuration: makeSystemAudioStreamConfiguration(), delegate: self)- try audioStream?.addStreamOutput(self, type: .audio, sampleHandlerQueue: sampleQueue)+ let candidate = SCStream(filter: filter, configuration: makeSystemAudioStreamConfiguration(), delegate: self)+ do {+ try candidate.addStreamOutput(self, type: .audio, sampleHandlerQueue: sampleQueue)+ audioStream = candidate+ } catch {+ // Like a failed start below: the take goes on, without its system audio.+ emit([+ "event": "warning",+ "code": "system-audio-unavailable",+ "message": "System audio could not be captured: \(error)",+ ])+ }}}outputWidth = target.width