If your Mac's audio suddenly silences, it may likely be that your headphones port has been taken over by its hidden and usually silent partner. The solution requires a low-tech device: a wooden toothpick.
The other day my MacBook Pro became silent and nothing I did seemed to fix it. First, I looked at settings in the Sound Preferences pane, which showed that it was set to Digital Output, a setting that was unfamiliar. Everything else, volume controls and the usual settings for the onboard speakers were either missing or grayed out.
I then opened the Audio Midi preference and checked the Audio Devices settings, which should show Built-in Output as the setting. But no, same problem. Digital silence.
Was this a software issue? I logged out of my usual user account and into one that I've created for testing such things. It's bare-bones but pure. It also was silent. So, the problem was hardware related.
After a while, I unplugged the notebook, picked it up and looked into the audio out port. It was glowing red. I had never noticed this behavior before. Since this was during the day and my MacBook Pro sits on a stand away from the surface of the desk, I hadn't noticed the change. It was odd.
A search offered the answer: it seems that the headphones port is dual-use or combo. Most of the time, it works as expected provided analog audio out to headphones or external speakers. However, it also serves as a minijack TOSLINK fiber optic connector, which Apple calls "optical digital output." This high-performance cable supports all kinds of multichannel audio.
The TOSLINK connector is just a skosh (0.5mm) longer than the stereo analog 3.5mm minijack. You can use a TOSLINK minijack cable or an inexpensive adapter that connects to less-expensive TOSLINK cable with plugs.
But the changeover to TOSLINK can happen at any time. It seems that when removing the headphones with a yank after editing some audio, I must have accidentally flicked a switch inside the port. The MacBook Pro thought that there was still a TOSLINK connector attached even though there wasn't anything plugged into the port.
Plugging and unplugging the headphones didn't help. And I tried sticking in a small screwdriver and a large paperclip. No change.
A thread on Apple's discussion boards suggested a wooden toothpick. For some reason, this worked. I also read that a small plastic coffee straw works.
If I had my MacBook Pro connected to a TOSLINK receiver, I know I would appreciate this dual-connector port. But I don't. So for me, this behavior belongs in the It's-not-a-bug, it's-a-feature department.