Permission to use Audio on Mac

I know this isn’t a MBS forum, but I use PortAudioMBS in my app, have for many years. Works great.

In a non-mother-may-I world, I would expect my app to run, I call PortAudioMBS, use it, and my app works, etc. But how does the Mac - rather, why does the Mac - rather, when does a Mac and udner what circumstances - ask for permission on the app-level (for example) “Can SuperAudioApp use your Headphone output?” dialog? And, if a user says “no”, does the Mac keep asking or does it remember that decision forever? How do you get that permission back?

I have a client where with my app he says it never asks, but other apps the mac ask[ed]. When he selects Built-In Output or Built-In Input, my app fails to acquire a audiostream. That’s really strange for the Built-In stuff. Is it a permission issue, and how could that be resolved?

Yes, I believe it does remember your choices. And I think you get them back by using System Preferences > Security & Privacy > Privacy tab, then in the left frame selecting a category like the camera or microphone or whatever, and the right frame will list the apps which have requested permission and allow you to toggle permission status. Or I think if you highlight an app and select the “-” button below the list, the OS should ask again the next time the app tries to use that resource.

In my Mojave instance, it lists microphone but not audio output. Not sure about newer OS releases. But the theory should be the same if audio output is being blocked now too.

Like many System Preference panes, to make any edits you have to first click the lock icon on the bottom and type your password.

Current examples should include an info.plist file to add to the project with the NSMicrophoneUsageDescription text. This tells the system you like to use microphone and the text for the dialog box to ask user. But that dialog is only shown once.

If the user clicks no, the user has to go to the system preferences to enable it.

FWIW, there’s an “add-on” section in this forum, made especially for these topics :wink:

Christian: My app doesn’t appear in the Security pane. I assume it’s because I didn’t include the NSMicrophoneUsageDescription in the info.plist. So, does that mean that my app will not use the audio input or output and also will never ask the user? In other words, it’s caught in the middle?

If this is true, than why does my (normal) Mac 10.14 allow audio in and out and never asks me - and never has asked me - about it?

If NSMicrophoneUsageDescription is missing, you are not able to get any microphone access.
This is to avoid hacked apps to access it if they never aimed to do so.

Is your application signed with the Harden Runtime option?
There’s two Audio Usage Messages, one for Audio and one for Microphone.

Can’t answer that one. What OS version are your customers running? Maybe it’s a thing with Catalina.

Thanks Sam, it was the Audio Usage items in AppWrapper. It’s so funny - I never would have thought that “Apple compatibility” would have so much to do with non-programming things! (But that’s something we’ve talked about a bunch.)

1 Like