Open a Terminal window and run:
Advanced Options and press the ENTER key select Audio and press ENTER. By default I think the option is Auto but you should try changing the option so it forces audio through HDMI then press ENTER to enable that mode. Exit
raspi-config by pressing the right arrow followed by selecting
If that still does not work you will need to edit the config.txt file:
sudo nano /boot/config.txt
Then in the file set
hdmi_drive=2, this means removing the
hdmi_drive=2. This un-comments that piece of code and means that it will run. Then press CTRL+X to exit the file and press the Y key twice.
A final thing you could change in the config.txt file is un-commenting the lines:
After you have finished making any changes be sure to reboot the Pi so the changes take effect.
If the solutions above don't work then its a case of trying a new cable. You could also try reinstalling Raspbian. The display you are using might not have audio built in or the audio system its connected to might not be switched on.
Make sure you check all of the obvious stuff first.