Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MAC Microphone Access
Forum Updated to NodeBB v4.3 + New Features

MAC Microphone Access

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 779 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dwende
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • D Dwende

      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

      A Offline
      A Offline
      alptugan
      wrote on last edited by
      #2

      @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.
      ss 2022-07-12 at 18.17.52.jpg

      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 :)

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply
        1
        • SGaistS SGaist

          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.

          A Offline
          A Offline
          alptugan
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved