This started happening randomly earlier tonight, and I haven't managed to find a fix just yet. I was encoding a video file for quite awhile (I don't think that parts important, but I thought I'd include it anyway) and then I tried to play a youtube video. I noticed there was no sound, so I tried to up the volume using the Volume Up key on the keyboard. The volume visualisation appeared on the screen like normal (albeit a bit laggy), but the sound still didn't change, neither did I get the usual 'click' noise you get when you change the volume. I went looking into the sound options in the system prefs. only to find that the Output Sound device was headphones. For a test I plugged in some headphones to see what happened and, low and behold, the Output Sound device changed to the Internal Sound and my speakers were working again, but only with the headphones plugged in. This lasted for about an hour until suddenly it just decided to fix itself. I though everything was fixed, until I tried to turn up the volume (mainly just to test if it was working properly) and that seemed to crash the system. Every time I would restart the system the sound would seemingly work for a few moments, until I attempt to play some sound through an app and effect the volume - at which point it would crash again. At one point when I started up the Mac the Toolbar icons in the top right of the screen wouldn't load up, and any app that I tried to open would either freeze, or cause the mac itself to freeze. This lasted for quite a while, until I loaded the Mac up again and it seems to be back to the original problem (Sound Output device stuck on headphones). I've never experienced a problem like this before on this Macbook, and am pretty stumped by it. Could anybody offer any advice or a fix? Cheers.