You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 29736d4
Browse filesBrowse the repository at this point in the historyBrowse files
fix(macos): record without the microphone when macOS lists no audio input
The capture helper set ScreenCaptureKit's captureMicrophone whenever the
request asked for the microphone, input or not. On a Mac with no audio
input, that take starts, and the next one in the same picker session
stalls in startCapture() after `ready`: the take after a Restart is lost.
The helper now records without the microphone when AVFoundation lists no
audio input and reports `microphone-not-found`. The main process passes it
on as `microphoneNotFound`, and the renderer shows the existing "No
microphone found" toast, also when its own pre-check drops a stored "on".
macOS 13 and 14 keep `microphone-unavailable`.
Part of #995
Copy file name to clipboardExpand all lines: electron/native/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ npm run build:native:mac
27
27
28
28
On non-macOS hosts this command exits successfully and does not affect Windows/Linux development. On macOS it builds the Swift package at `electron/native/screencapturekit`, writes the development binaries to `electron/native/screencapturekit/build`, and copies redistributable binaries to `electron/native/bin/darwin-${arch}`.
29
29
30
-
The current helper implementation supports display/window ScreenCaptureKit video capture, control-window exclusion through the request's optional `excludedWindowIds` and `SCContentFilter(display:excludingWindows:)`, cursor exclusion through `SCStreamConfiguration.showsCursor`, H.264 encoding, MP4 muxing (with `AVAssetWriter.movieFragmentInterval` at 1s, so a helper that dies before `finishWriting()` still leaves a readable file — same reasoning as the Windows fragmented sink below), and ScreenCaptureKit system audio. Electron supplies only the HUD and an open Notes window as exclusions for a direct full-display capture, so ordinary OpenScreen windows remain recordable there. The helper adds Notification Center's windows on its own, and Finder's desktop-icon windows when the request sets `hideDesktopIcons`; a banner appears as a new window, so a direct capture re-reads the exclusion every 250 ms, while the system picker excludes Notification Center by bundle id. It excludes OpenScreen itself the same way, so a screen picked in the editor's Record mode still leaves out the HUD that only appears at Start: a picker capture records none of OpenScreen's windows, and window mode does not offer them. The helper reports this as `excludesApp` on `picker-selected`. The helper also attempts native ScreenCaptureKit microphone capture when the running macOS version exposes that capability, which is macOS 15 and later. Below that it records the take without the microphone and emits a `microphone-unavailable` warning; the app does not offer the microphone there (`canRecordMicrophone` in `src/utils/platformUtils.ts`). Webcam recording currently stays as an Electron sidecar and is attached to the same recording session after the native screen capture stops.
30
+
The current helper implementation supports display/window ScreenCaptureKit video capture, control-window exclusion through the request's optional `excludedWindowIds` and `SCContentFilter(display:excludingWindows:)`, cursor exclusion through `SCStreamConfiguration.showsCursor`, H.264 encoding, MP4 muxing (with `AVAssetWriter.movieFragmentInterval` at 1s, so a helper that dies before `finishWriting()` still leaves a readable file — same reasoning as the Windows fragmented sink below), and ScreenCaptureKit system audio. Electron supplies only the HUD and an open Notes window as exclusions for a direct full-display capture, so ordinary OpenScreen windows remain recordable there. The helper adds Notification Center's windows on its own, and Finder's desktop-icon windows when the request sets `hideDesktopIcons`; a banner appears as a new window, so a direct capture re-reads the exclusion every 250 ms, while the system picker excludes Notification Center by bundle id. It excludes OpenScreen itself the same way, so a screen picked in the editor's Record mode still leaves out the HUD that only appears at Start: a picker capture records none of OpenScreen's windows, and window mode does not offer them. The helper reports this as `excludesApp` on `picker-selected`. The helper also attempts native ScreenCaptureKit microphone capture when the running macOS version exposes that capability, which is macOS 15 and later. Below that it records the take without the microphone and emits a `microphone-unavailable` warning; the app does not offer the microphone there (`canRecordMicrophone` in `src/utils/platformUtils.ts`). With no audio input listed it does the same and emits `microphone-not-found`: asked for a microphone anyway, ScreenCaptureKit starts that take and stalls the next one in the picker session (#995). Webcam recording currently stays as an Electron sidecar and is attached to the same recording session after the native screen capture stops.
31
31
32
32
Electron exposes `is-native-mac-capture-available` for capability probing. It resolves the same helper locations listed above and reports `missing-helper` until a Swift helper binary is present. When available, macOS recording routes screen/window capture through the native helper so editable cursor recordings do not bake the system cursor into the video. Cursor positions are sampled in Electron; when the cursor helper is available and Accessibility is granted, samples are also tagged with link/text cursor hints such as `pointer`.
it("is false when this macOS cannot capture the microphone",()=>{
178
+
constoutput=
179
+
'{"code":"microphone-unavailable","event":"warning","message":"Native microphone capture requires ScreenCaptureKit microphone support on this macOS version."}\n';
0 commit comments