How to change audio output / input from terminal in OSX

Modified: 5 months, 4 weeks ago
Published: 6 months, 1 week ago

To install open terminal and run
brew install switchaudio-osx

To list all the sources for input / output run
SwitchAudioSource -a

This will produce output similar to

External Microphone (input)
MacBook Pro Microphone (input)
External Headphones (output)
MacBook Pro Speakers (output)

To switch microphone to External Microphone issue following command

SwitchAudioSource -t input -s 'External Microphone'