A command-line utility to switch the audio source on Mac OS X.
This utility switches the audio source for Mac OS X.
You specify the name of the audio source, such as Built-in Digital Output, and the utility switches the source immediately without any GUI interaction.
This is a command-line utility only and has no graphical user interface. Tested on OS 10.7 - 11.2.
brew install switchaudio-osx
SwitchAudioSource [-a] [-c] [-f format] [-t type] [-n] -s device_name | -i device_id | -u device_uid
The -m
flag can be used to mute input or output devices.
Define the device via -t
.
Example for toggling the mute state for the currently selected input, e.g. microphone:
SwitchAudioSource -m toggle -t input
This is useful on a hotkey, e.g. to mute your Teams or Zoom input.
Thanks to Christian Zuckschwerdt for migrating this to github and adding the next option.
MIT License, see license.txt
Copyright (c) 2008-2021 Devon Weller wellerco@gmail.com
Copyright (c) 2011 Christian Zuckschwerdt zany@triq.net