Audio not working after sleep and after use with headphones issue Macbook Pro Retina 2013

I had the issue that any time I had headphones connected to my Macbook Retina (late 2013), my audio would stop working after waking up from sleep. If I plugged them in when the computer was on it didn’t always work either. I tried all of the normal Pram reset, smc reset and all that. Nothing seemed to help. To get audio working again I had to restart my mac. What happens when you restart the mac is that all drivers and kernel extensions reload, so instead of doing that I created a small application that does that for you. If you want to, you can do it yourself in the terminal by typing

sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext

Pretty simple but I found it frustrating to have to do it every time it happened so here’s an app you can put in your dock. This might work if you have other audio issues as well. I won’t guarantee anything though. If you mac stops working forever, I won’t take responsibility. This app has worked for me many times. Some times your audio driver won’t unload for other reasons and then you might need to restart any way but this should save you the trouble most of the time.