The sound simply doesn't work, I'm using HDMI on a large flat-screen TV. Earlier today I had it working with HDMI on a smaller TV that is not a flat-screen. I have heard that it may have something to do with the resolution.
Open raspi-config by typing sudo raspi-config into the terminal.
Select option number 7 Advanced Options by moving the red bar with the arrow keys, and press Enter.
Select option A4 Audio, and press Enter.
Select option 2, and press Enter once more. It should now output audio to HDMI.