How to disable audio input (microphone) in Juce?

Hi all!

My application is crashing in Mojave OS, because it is missing microphone access. Adding the NSMicrophoneUsageDescription to info.plist is fixing the crash, but I don’t want to use the microphone and don’t want to bother the user by asking it. The app is meant to use only camera and not audio input.
How can I disable the audio input (microphone)?
I tried using a solution I found here in the forum:
audioDeviceManager.initialise(0, 2, nullptr, true);
But that didn’t fix the problem (app is still crashing without the plist flag).
If that is really the solution, where and when should I use it?

And another doubt I have regarding that solution: In order to use the audioDeviceManager.initialise, I need to add a lot of header files and framework references. Does it make sense, to add all that audio files just to declare that I don’t want to use audio?


1 Like

I never worked with camera input, but what I know is that the audio captured by the camera and written to the specified File is not processed by the juce audio callback facility that gets configured with the AudioDeviceManager. Instead it uses some system API, depending on the OS the application runs on to handle this job. So it would be perfectly possible to record audio and video with the CameraDevice while capturing audio with the AudioDeviceManager in parallel, which could come from the same input or some different audio interface (except for Android according to the docs). Think of two different DAWs running in parallel and both accessing the input device and recording from it.

This means setting the input channel count to 0 like you did does not even affect the audio path the camera recording uses, so the OS still recognizes that you access the microphone. It is possible that the various OS camera APIs might allow video recording without sound, I really don’t know that, however if it would be possible you would need to handle all camera stuff directly with the OS camera API as the juce CameraDevice has no option to start a video recording without the sound…

Maybe someone around here has tried this before and knows more