feat(coreaudio): add macOS system audio permission helpers#1124
feat(coreaudio): add macOS system audio permission helpers#1124thewh1teagle wants to merge 1 commit intoRustAudio:masterfrom
Conversation
94bbe7e to
b262f4e
Compare
b262f4e to
cfeaede
Compare
|
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! |
|
Feel free to create a PR against my branch or open another PR with me as a co-author :) |
|
Thinking out loud: Since requesting permissions is a blocking operation showing a system-modal dialog, how about taking a middle road? In Then, we keep Going forward I would like to expose host-specific functionality with extension traits. Please refer to #1074 for an ongoing discussion how to do that for ASIO (getting the API right for all hosts) as well as an outlook on how to expose new error variants. |
I was using cpal 0.18.0 (master) for loopback recording on macOS and needed to check and request the
System Audio Recordingpermission before recording. Without it, recording succeeds butcaptures only silence.
Added three public functions on macOS:
cpal::check_system_audio_permission()— silent check, no UIcpal::request_system_audio_permission()— shows system prompt, blockingcpal::open_system_audio_settings()— opens Privacy & Security > System Audio RecordingUses the private TCC framework (
kTCCServiceAudioCapture) vialibloading.block2andobjc2-core-foundationwere already transitive dependencies so no significant dep overhead.Related