I found that I had to do both of the things suggested above. 1. hdmi_drive=2 in config.txt 2. -Raspi-config -advanced -audio -force hdmi
If I just did one or the other, it wouldn't work. I did have one situation where I couldn't get it to work have doing a lot of messing around with things and had to reflash by card. The link below is a further discussion of my many audio issues.