I have been experiencing some sound output issues on my MacBook Air recently, and a quick Google search revealed that many people have been experiencing the same problem. Here is a short description of the the problem and my solution.
What's the problem?
I like to use ear phones with my MacBook. The sound works fine when I first boot up, however, if I am away from the computer and it goes to sleep (e.g., during lunch), the volume icon is greyed out when I wake the computer. The sound does not work and I cannot adjust the volume. Very annoying.
Sound is affected on a system-wide level. This is not restricted to a single app. Rebooting the computer resolves the issue, but this is not something I want to be doing all the time. Other users recommend flushing PRAM and doing all sorts of weird things in the Terminal that I don't want to be part of my regular workflow. Ideally, I'd like to do something once that fixes the problem for good.
When the volume icon is greyed out, click System Preferences | Sound | Output and select Headphone port as your device for sound output. That's it.
And there you have it. A simple solution to a persistent and complex problem.