Start with the easy things first,
1) Right click on the master volume control in the upper right corner, then open the volume control panel. Note the in the title bar that your sound card is properly identified followed by the words "Alsa mixer" in parentheses.
2) In the playback tab, make sure the appropriate outputs aren't muted or set too low.
3) In the Switches tab check the appropriate boxes for your network.
4) In the Options tab, select the appropriate "Surround jack mode."
Test your sound system and see if that worked. If not, check all your jack connections and make sure none are loose, then test the sound again.
If all that fails, then it gets a little more difficult.
Make note of all the other programs that are running when the problem strikes and try stopping them, one at a time, then testing the sound to see if that program is conflicting with your sound card driver and if not, then start it again and move to the next one.
If that doesn't solve the problem, you will need to get the specific name and model of your sound card and distro version then check the Ubuntu site, in the support section, and see if there is any info there on your particular hardware.
If you still have the same problem, come back here and post the particulars about your hardware and distro and see if someone here can offer more advice.
If it ain't broke, you aren't trying hard enough.