Digital audio & video have a latency/delay. If using hdmi as video output, you should also route the audio through the hdmi, and for sure not use the sound card (or motherboard) analog output. Otherwise you lose the sync between audio & video.
To use different equipment for sound playback than the hdmi receiving device, you have to route the sound from that device to another device.
There are devices which enable you to merge an audio signal into an hdmi signal, but these are rather expensive pro-AV equipment, which you don't want to bother yourself with. Just use the hdmi audio driver when using hdmi for video output to keep everything in sync.
Concerning sound quality: This will depend on the quality of your DAC (=digital to analog converter). Hdmi is a digital stream of data, the playback device will (most probable) be the DAC of your hdmi receiving device. A soundcard has it's own DAC. The best quality will be provided by the which of both has the best DAC. (standard soundcards use budget DAC's, cheap monitors/TV's have the same)
Which graphics card do you have? Some cards have an SPDIF port designed for exactly this. See: http://forums.pcper.com/showthread.php?478709-HDMI-AUDIO-passthrough
– Robert Rouhani – 2013-08-11T10:02:54.240It is a GTX 470 and as far as I can see there is no sound input. Is there no way then? – danijar – 2013-08-11T10:11:30.020
Yeah, it looks like the GTX 400 series and beyond routes audio via the PCI-e bus. FWIW, Your graphics card should be able to output the same quality sound. I say that since it's still all digital at that point, quality will be primarily determined by the quality of the DAC the audio is run through further down the line. Here's a great forum thread on the subject: http://hardforum.com/showthread.php?t=1648732
– Robert Rouhani – 2013-08-11T10:31:27.400