vercel-labs / vercel-labs/native

Design: add macOS system and microphone audio capture

Open
#254 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Zig
Stars
7.7k
Forks
314
Avg merge
5h
Merged PRs (30d)
13

Description

Motivation

Native SDK exposes audio playback but not audio input. Meeting recorders and similar apps currently need an app-specific native helper for system and microphone capture.

Proposed scope

  • macOS 15+ AppKit system-host implementation.
  • Capture system audio, a selected/default microphone, or both into one signed 16-bit PCM WAV.
  • Enumerate connected microphones and emit a devices-changed invalidation.
  • Explicit permission status/request effects; capture start never prompts.
  • Zig and TypeScript command/event parity with replay-safe fixed records.
  • Manifest privacy strings and generated macOS Info.plist entries.
  • Honest feature discovery and unsupported results on older macOS and other hosts.

Proposed API

Features: system_audio_capture, microphone_capture, and microphone_device_enumeration.

Zig effects: startAudioCapture, stopAudioCapture, listMicrophoneDevices, and audioCaptureAccess.

TypeScript commands: audioCaptureStart, audioCaptureStop, microphoneDevices, audioCaptureAccess, plus a microphoneDevicesChanged subscription.

Native implementation

Use ScreenCaptureKit for system-only and combined capture, and AVFoundation for microphone-only capture. Timestamp-align and resample buffers, mix combined sources with headroom, write through a sibling temporary file, and atomically publish the finalized WAV. Allow one active capture and preserve a finalized partial file after asynchronous failure.

Packaging

Add a logical system_audio permission plus microphone_usage and system_audio_usage privacy strings. Generate the relevant microphone, ScreenCaptureKit, and system-audio purpose keys. App Sandbox remains opt-in; document the audio-input entitlement.

Out of scope

Raw PCM delivery, meters, video capture, per-app audio filtering, source gains, and app-specific meeting UI.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Zig effects and TypeScript command/event entry points named in the proposal, then trace the macOS native integration for ScreenCaptureKit and AVFoundation. Define how capture, device enumeration, permissions, replay-safe records, packaging privacy keys, and unsupported hosts should behave; done means the proposed API and native behavior are implemented end to end.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, typescript, zig
Domain
audio-video-rtc, desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.