Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@viktorklang
Created December 11, 2016 08:05
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save viktorklang/c951c27505e2b80852398a9f1cf0496e to your computer and use it in GitHub Desktop.
Save viktorklang/c951c27505e2b80852398a9f1cf0496e to your computer and use it in GitHub Desktop.
Emergency audio reset on OS X / macOS when faced with loss of audio
#Use at your own risk. No warranties expressed or implied. YMMV. Drive responsibly. Eat healthy.
#for ZSH, I typically put these in my .zshrc
function restart_audio() {
command sudo killall coreaudiod &&
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist &&
sudo launchctl load /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist &&
echo 'Audio daemon restarted'
}
#alternately just run this in your terminal:
#sudo killall coreaudiod &&
#sudo launchctl unload /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist &&
#sudo launchctl load /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist &&
#echo 'Audio daemon restarted'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment