MAC Microphone Access
-
I am developing an QT 6.3 app which uses a Sound-Input on a Mac M1.
Despite struggling with QT6.3, and the new structure. I got the code to compile and run, yet all the Microphone data is null.
After much struggling (porting back to QT 5.8 !!) - same result.
Then I switched to iTerm and moved to the build directory
cd /Users/tim/Dev/QT/build-FSK-Qt_6_3_0_for_macOS-Debug/TestFSKWin/TestFSKWin.app/Contents/MacOS
Then I ran the app using
./TestFSKWin
This time I got a Mac-Security popup "Do you want to allow iTerm to access the Microphone". - I said Yes... and magically it works.... But it will not work if I run through QT-Creator.
Puzzled I enabled the Run option, to "run in terminal" and added Terminal (I generally use iTerm - which I indicated earlier) to be able to access the Microphone. Which also allows Microphone data to flow when run outside QT.
Does anyone know how to resolve this ?
QT Is listed as an App that is Authorised to access the Microphone.... but obviously something is blocking
Any assistance would be appreciated
Tim
-
I am developing an QT 6.3 app which uses a Sound-Input on a Mac M1.
Despite struggling with QT6.3, and the new structure. I got the code to compile and run, yet all the Microphone data is null.
After much struggling (porting back to QT 5.8 !!) - same result.
Then I switched to iTerm and moved to the build directory
cd /Users/tim/Dev/QT/build-FSK-Qt_6_3_0_for_macOS-Debug/TestFSKWin/TestFSKWin.app/Contents/MacOS
Then I ran the app using
./TestFSKWin
This time I got a Mac-Security popup "Do you want to allow iTerm to access the Microphone". - I said Yes... and magically it works.... But it will not work if I run through QT-Creator.
Puzzled I enabled the Run option, to "run in terminal" and added Terminal (I generally use iTerm - which I indicated earlier) to be able to access the Microphone. Which also allows Microphone data to flow when run outside QT.
Does anyone know how to resolve this ?
QT Is listed as an App that is Authorised to access the Microphone.... but obviously something is blocking
Any assistance would be appreciated
Tim
@Dwende Thanks for the suggestion. Really magically worked for me.
When I try to double-click and run the app it does not work.
Then, I edit the .plist file as follows.
Since I have two different .plist files, I edited also the one in the "Contents" folder;
TestFSKWin.app/Contents/Info.plist.This is non-sense, but it works so the last step was,
right-click on my app "get info" and change "Sharing & Permissions" for "staff" and "everyone" as "Read & Write".
Run the app and It displays the access message. Now it work in Qt Creator and standalone app.Then I revert back to default "Sharing & Permissions". Tested again. It still works.
Thanks for your suggestion. I was going to give it up :) -
Hi,
When you want to add such functionality to you application, you have to use your own .plist file. You can start from the auto generated one that you get in the application bundle.
See the qmake documentation for more details.
-
Hi,
When you want to add such functionality to you application, you have to use your own .plist file. You can start from the auto generated one that you get in the application bundle.
See the qmake documentation for more details.
Hi @SGaist,
Thanks for the reference page.
I cannot find where to edit? Is there a default .plist template in Qt Creator app folder?I use Qt Creator to build openFrameworks projects.
I checked each .qbs files and many other setup files, but cannot find any file or script to edit automatically created .plist file for the compiled app. -
No there's not.
As I wrote, copy the one that was generated from the bundle back to your sources and use that one.
You can add fields as described in the documentation I linked.