First what is the sound coming through hdmi, 3.5mm audio jack, etc?
Audio jack, I'm using a Steel Series headset and it works just fine.
So it is working now no more issue?
No the headset works just fine, it's just the sound still shuts off randomly and I have to restart my computer to fix it
Try hdd and memory tests.
Make sure all drivers are up to date.
When did this start happening? Click Start > in the Search programs and files text field type view reliability history > click view reliability history > From the date it started happening this will show things that have happened on your windows 7 computer. Blue circles with ! indicate software/hardware install/update, red circle with x indicate errors.
Also see if your computer needs to be cleaned of dust. Follow proper computer cleaning procedures to do so (google is your friend).
Scan your computer for infections, viruses, malware, etc. FYI I have found that some virus protection do not always detect an infection.
Does this happen with videos just online? Can you play a downloaded video with out loss of audio?