Skip to content

[Bug]: macOS mic sidecar (.m4a) is blocked by the media allowlist, so #912 still reproduces #1016

Description

@samir-orozco

Summary

Follow-up to #912 (closed by #913): the microphone is still silent in the editor and in exports on macOS.

On macOS the mic track is always written to a recording-<ts>.mic.m4a sidecar, but .m4a is missing from MEDIA_CONTENT_TYPES in electron/mediaTypes.ts. resolveApprovedLocalMediaPath() rejects anything that fails isSupportedLocalMediaPath(), so get-local-media-url refuses the sidecar and the main process logs:

[get-local-media-url] Blocked disallowed path: .../recording-1790029932535.mic.m4a
[get-local-media-url] Blocked disallowed path: .../recording-1790029932535.system.m4a

Environment

  • Recordly v1.4.0, built from main @ 49926862 (arm64). The same allowlist ships in the released v1.4.0 — 7e87356c is contained in the tag — so this is not specific to a local build.
  • macOS 15.4.1 (24E263), Apple Silicon
  • Backend: mac-screencapturekit (native capture helper)

Steps to reproduce

  1. Enable Microphone and System audio in the launch HUD.
  2. Record ~20s of a display while speaking.
  3. Stop, and play back in the editor.

Expected: the microphone is audible.
Actual: silence in preview and export, while the voice sits on disk in the sidecar:

recording-<ts>.mp4          mean_volume: -91.0 dB   max_volume: -91.0 dB
recording-<ts>.mic.m4a      mean_volume: -34.0 dB   max_volume: -12.7 dB
recording-<ts>.system.m4a   mean_volume: -91.0 dB   max_volume: -91.0 dB

Root cause

muxNativeMacRecordingWithAudio() keeps the audio tracks as sidecars by design, and the renderer already expects them: SOURCE_SIDECAR_EXTENSIONS in src/components/video-editor/timeline/sourceAudioTracks.ts lists .m4a, and src/lib/exporter/localMediaSource.ts maps .m4a to audio/mp4. Only the main-process media allowlist is missing the type, so every sidecar request is denied. resolveMediaResourceUrl() then falls back to a file:// URL, which the editor window cannot load because it is served over http from the local media server.

Fix

One line in electron/mediaTypes.ts:

 	".mp3": "audio/mpeg",
+	".m4a": "audio/mp4",
 	".ogg": "audio/ogg",

This does not widen the path allowlist: isAllowedLocalReadPath() still scopes reads to the recordings directory, userData, the asset root and temp. With this patch applied locally, mic audio plays in the editor and survives export, and npx vitest --run passes (226 tests, including electron/mediaServer.test.ts and electron/ipc/project/manager.test.ts).

Happy to open a PR if that helps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions