0

I am creating a game which requires microphone input using the Cinder library. I am using CLion with CMake as my build system, but I am pretty new to CMake. The app is unable to access the microphone input; there are no errors.

auto ctx = ci::audio::master();
ci::audio::InputDeviceNodeRef input = ctx->createInputDeviceNode();

input >> ctx->getOutput();
input->enable();

Even when I simply set the output node of the input device to the speakers there is no sound. How do I make my app request microphone permissions?

I found that in an XCode project, there is an Info.plist key which allows for this:

<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for playing the game</string>

Is there a similar equivalent in CMake, or a way to use Info.plist files in a CMake project?

Running on macOS Catalina 10.15.3

Thank you in advance!

  • Does this answer your question? [Customising MacOS Bundle's Info.plist file with CMake](https://stackoverflow.com/questions/42313808/customising-macos-bundles-info-plist-file-with-cmake) – Kevin Apr 22 '20 at 22:00
  • 1
    Unfortunately, I don't know if tha twill work for me. I don't need to change values in the Plist but just for the Plist to be read and recognized properly. I am not sure how the CMake bundles work, I tried adding the given CMake code into my CMakeLists.txt with the required modifications but it didn't seem to work. I was able to build with a sample Info.plist that I made, but on running the program I get `error parsing the Info.plist for the bundle at URL <0x7fc9c9c25ea0>: NSCocoaErrorDomain - 3840` repeated 4 times. – Shiven Kumar Apr 22 '20 at 22:20

0 Answers0