While I cannot guarantee that any of these will work (you may indeed have a hardware issue or something else going on), these possible fixes only take a few minutes to test. Before you throw you laptop out the window, or spend time and money bringing your computer into the Apple store to talk to the Genius Bar, you should test out each of the items below. It seems that this odd issue happens all of the time to people, so I wanted to provide 7 things that you could try before deciding it is a hardware problem (which it could well be).
Sound Input was fine and the built-in microphone responded to sound. When I went to check the Sound Preferences Pane, it showed that I had no devices whatsoever. Clicking the volume keys or the mute button did nothing, no sound, and basically the onscreen display showed a symbol that indicated there was no device for the sound output anyway. A few days ago, my MacBook Pro decided suddenly to tell me that it had no Output Audio Devices for sound.