2

Since macOS Mojave apps now need to ask for permission to record audio. I want to record it from the built-in microphone of my Macbook.

This means that a lot of old tools are broken. For example, sox and ffmpeg don't work anymore.

With ffmpeg I tried ffmpeg -f avfoundation -i ":1" -t 10 output.mp3, which results in no file being even created.

With sox I tried sox -d output.wav, which produces a file but with no sound in it.

So does anyone have a workaround or other CLI utility that can do this?

1
  • 10.14.1 beta seems less restrictive & has fixed a lot of my 'hang-over' gripes from the point zero, though idk for your particular requirement, sorry.
    – Tetsujin
    Commented Oct 18, 2018 at 15:21

2 Answers 2

2

They have restricted access to the microphone from the terminal by default after the update.

You need to go to System Preferences > Security & Privacy > Privacy > Microphone and tick the box for the terminal and it should all work again.

2

If Terminal isn't showing up in the System Preferences list for microphone permissions and it hasn't requested permission (a problem on Mojave/Catalina), 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 

(Note: You will need to install SoX. This specific command will let you hear your mic input. You could also use pyaudio, FFmpeg, ecasound etc.)

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 very similar to the one for Audacity on Catalina. I'm not sure what the exact cause is though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .