How do I get sound to output to my TV speakers?

view story

http://askubuntu.com – When I boot Ubuntu 12.04 from a USB drive, I am unable to get sound to output through my TV speakers while having my machine connected via HDMI cable. Using Windows 7, the sound switches from the computer speakers to the TV speakers without a problem. I have a Nvidia Geforce 310M. When I look at my computer specs using Speccy, it says that my sound cards are Nvidia high definition audio (four of them) and one RealTek High Definition Audio. Under playback devices it says speaker/hp out (realtek hd audio)(default) and digital output (optical) (realtek hd audio). (HowTos)