Skip to content

feat(coreaudio): add macOS system audio permission helpers#1124

Open
thewh1teagle wants to merge 1 commit intoRustAudio:masterfrom
thewh1teagle:feat/macos-system-audio-permission
Open

feat(coreaudio): add macOS system audio permission helpers#1124
thewh1teagle wants to merge 1 commit intoRustAudio:masterfrom
thewh1teagle:feat/macos-system-audio-permission

Conversation

@thewh1teagle
Copy link

I was using cpal 0.18.0 (master) for loopback recording on macOS and needed to check and request the System Audio Recording permission before recording. Without it, recording succeeds but
captures only silence.

Added three public functions on macOS:

  • cpal::check_system_audio_permission() — silent check, no UI
  • cpal::request_system_audio_permission() — shows system prompt, blocking
  • cpal::open_system_audio_settings() — opens Privacy & Security > System Audio Recording

Uses the private TCC framework (kTCCServiceAudioCapture) via libloading. block2 and objc2-core-foundation were already transitive dependencies so no significant dep overhead.

Related

@thewh1teagle thewh1teagle force-pushed the feat/macos-system-audio-permission branch from 94bbe7e to b262f4e Compare March 5, 2026 05:25
@thewh1teagle thewh1teagle force-pushed the feat/macos-system-audio-permission branch from b262f4e to cfeaede Compare March 5, 2026 05:39
@SuperKenVery
Copy link
Contributor

I think it might be better if we check permission when recording from an output device, and if we don't have it, request it.

Do you think it's better? cc @roderickvd

If you agree, I can file a PR agains your branch!

@thewh1teagle
Copy link
Author

Feel free to create a PR against my branch or open another PR with me as a co-author :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants