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?