Hey, I have a 17" MacBook Pro (Late 2011) running OS 10.10.2 and had the same thing happen, but only my headphone jack port stopped working. The internal speakers were fine. But if everyone else's suggestions don't work I have a new cheap fix!!!
I looked it up and saw that people said to twiddle a toothpick or whatever in the headphone jack port. I tried that with a paperclip and it worked. But the next day it happened again so I used the the paperclip again. It worked, BUT I must have damaged a component so everything sounded garbled.
I went to the Genius Bar to see if there was anything they could do but all they suggested was to replace the logic board which costs nearly $800 (AUD)!
NOW FOR THE CHEAP FIX!!!
A friend of mine suggested I use a HDMI cable because they transfer video and audio. I got a Belkin Mini DisplayPort to HDMI Adaptor as well as a HDMI cable and connected it to my monitor. Then go to Sound in System Preferences. Under output, select your monitor. Then connect your headphones to your monitor's headphone jack port! Et voilá!!! $50 worth of cables fixed my problem. . .
The volume isn't exactly as adjustable as it was before. . . But hey, it works and saved me $750!