- Create a
/usr/local/bin/audiointerfaceswitch.sh file
with the content above. Change "FiiO USB DAC-E10" with the name of your interface. Run/usr/local/bin/SwitchAudioSource -a
to get a list of the available interfaces on your system. - With Automator.app, create an app
- Run the app to switch interfaces. Use a launcher or BetterTouchTool or a similar tool to map the app to a keyboard shortcut.
Last active
December 11, 2018 00:09
-
-
Save simonjodet/211fe010d842527c09d357724060282b to your computer and use it in GitHub Desktop.
Quick audio interface switch for Mac OS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CURRENTINTERFACE=`/usr/local/bin/SwitchAudioSource -c` | |
EXTERNALINTERFACE="FiiO USB DAC-E10" | |
if [ "$CURRENTINTERFACE" = "$EXTERNALINTERFACE" ] | |
then | |
/usr/local/bin/SwitchAudioSource -t output -s "Built-in Output" | |
/usr/local/bin/SwitchAudioSource -t system -s "Built-in Output" | |
else | |
/usr/local/bin/SwitchAudioSource -t output -s "$EXTERNALINTERFACE" | |
/usr/local/bin/SwitchAudioSource -t system -s "$EXTERNALINTERFACE" | |
fi | |
/usr/local/bin/notify "`/usr/local/bin/SwitchAudioSource -c`" "Current audio interface" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment