Can Terminal access the microphone in Catalina? (for SoX, FFmpeg, Ecasound, pyaudio etc.) When I try to record audio from the command line with programs such as SoX or FFmpeg it doesn't record anything and ends up with a flat-line recording. I am guessing this is due to privacy restrictions from macOS Mojave/Catalina. This is similar to the issue Audacity is having, in which the fix is opening it from the terminal to trigger a request for microphone permissions. 

This answer suggests granting Terminal access to the microphone from System Preferences. However, it will only show up in the list if Terminal requests it. So is there a way to grant an application unrequested permissions?

I also saw that Apple tech support have said non-GUI apps can't access the mic. Does this mean command line audio recording is completely broken? As it seemed to work perfectly on previous versions, could there be a fix for it like there is for Audacity?
If Terminal isn't showing up in the System Preferences list for microphone permissions, open it by:

open /System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal


Then run a program that uses the mic e.g.

sox -d -d 


(Not a pre-installed program. This will let you hear your mic input)

That should trigger it to request. If that didn't work try running the command on a different command line e.g. iTerm2. This is a problem and solution similar to the one for Audacity on Catalina. I'm not sure what the exact cause is though.