For a start read through this article I found via a Google search. There is a "possible solution" to your problem at the bottom of the article. Using my laptop (pc) I had to change my audio output settings for the HDMI sound to work.
<-snip-> Use an audio extractor ($15-$300)
Don't have an old Apple TV or optical out port on your television but still want to enjoy the benefits of optical out? Pick up an HDMI-to-Toslink (optical audio) extractor. This lives in-between your TV and Apple TV, routing the Apple TV's HDMI connection through a tiny box that separates the HDMI video signal and the audio signal. To make this work, you'll need a spare power port and extra HDMI cable.
The simplest of these boxes starts at just $15, with more expensive models going upwards of $300. I recently picked up the $31 ViewHD HDMI audio extractor, which I like a lot—it has the option to route audio either via optical out or RCA.
What you'll need: Audio extractor, extra HDMI cable, optical audio cable.