Closed jafioti closed 5 months ago
Ok I worked out the issue. The solution was found here: https://github.com/tauri-apps/tauri/issues/8314#issuecomment-1829864033
You basically need a seperate entitlements file with the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
</dict>
</plist>
and need to reference that file in your tauri conf
@jafioti thanks for this
by any chance do you know how to use audio screen capture? https://github.com/RustAudio/cpal/pull/894
like which permissions i need? i can correctly record mac microphone but get denied display audio recording
tried bunch of things
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSMicrophoneUsageDescription</key>
<string>This app requires microphone access to record audio.</string>
<key>NSScreenCaptureUsageDescription</key>
<string>This app requires screen capture access to record the screen.</string>
<!-- <key>NSSystemExtensionUsageDescription</key>
<string>This app requires system extension access to capture audio output.</string> -->
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- <key>com.apple.security.device.audio-input</key>
<true/> -->
<!-- <key>com.apple.security.temporary-exception.audio-unit-host</key>
<true/> -->
<!-- <key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<array>
<string>com.apple.audio.coreaudiod</string>
<string>com.apple.audio.audiohald</string>
</array> -->
<!-- <key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.microphone</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.screen-capture</key>
<true/>
<key>com.apple.developer.persistent-content-capture</key>
<true/>
<key>com.apple.developer.sustained-execution</key>
<true/> -->
<!-- <key>com.apple.security.temporary-exception.sbpl</key>
<string>(allow mach-lookup (global-name-regex #"^com.apple.coreservices.launchservicesd$"))</string>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.automation.apple-events</key> -->
</dict>
</plist>
I had the same issue with mic permission. fixed in https://github.com/thewh1teagle/vibe/commit/f30d6d61d0bcae7cb63f8b75b3adea2e4695ff71 Works for both mic and screen audio recording.
Describe the bug
I'm trying to record audio from rust, using cpal on macos. It seems to work correctly when the app is in dev mode, or built but not signed. Once the app is signed, even with the following Info.plist:
the permission popup does not appear and the microphone does not record any audio.
Is it possible to access the microphone from rust, or does it need to be done on the JS side?
Reproduction
Create a new app with an Info.plist:
and use cpal to start recording:
Expected behavior
This should request access to the microphone, show the recording icon in the rop right and start recording audio from the microphone, but when the app is built and signed none of that happens.
Full
tauri info
outputStack trace
No response
Additional context
No response