Skip to content

Instantly share code, notes, and snippets.

@crudh
Forked from viktorklang/restart_audio.sh
Created December 11, 2016 18:59
Show Gist options
  • Select an option

  • Save crudh/3f0e6af99d2a8d59050e2a9d7450e816 to your computer and use it in GitHub Desktop.

Select an option

Save crudh/3f0e6af99d2a8d59050e2a9d7450e816 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