The two most likely causes of losing the audio is that either the headset cord and plug has a bad or loose wire in the plug, or that the port which the headset is plugged into has a bad connection inside the port.
Is your headset the type that includes a microphone? If so, the plug on the cord has three connections, not two.
Is the headphone cord fully plugged in? If it's almost but not quite all the way in that could cause the problem.
Is the computer a laptop or PC?
Does the problem also occur if you use a different headset?
Does the problem occur at any volume setting, or just when the volume is loud?
The audio output from my headset stops functioning when playing games that are graphically intense and requires me to switch audio outputs back and forth to fix it, the mic still works, only the audio cuts out. I’ve looked in a lot of places for similar issues and was wondering if anyone could offer some assistance here?

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic