Another problem can be with the headphone jack itself: This is what another person said:
The headphone input jack is stuck, there is a small switch inside the jack which shuts off the speakers when headphones are plugged in. When the headphones are pulled out, the speakers turn on again.
The thing you have to do is figure out which headphone jack you were using when you noticed this(i'm assuming you have 2 like mine).
My problem was that my girlfriend put an iPod video cable into my headphone jack to connect it to our stereo. It fits the hack but instead of a stereo 1/8" plug with 2 sections, it has 3 which makes it slightly longer which is what stuck the internal switch inside the jack and disabled the speakers.
Rather than bringing my computer to get fixed, I just took a pair of headphones and inserted them into the jack repeatedly, at different speeds. Mostly what worked was putting it in and pulling it out rather quickly. have a song playing looped while you do it so that you can tell if it worked or not. It will take some time and patience.