Generally speaking, internal sound cards inside computers are highly susceptible to the electrical noise generated by the electrical circuits. Specifically, any sound circuits that aren't made specifically to have the electromagnetic compatibility for good analog audio output can be problematic. What's worse, different software can inadvertently create phantom noises!
The problem can be either or both hardware and software. To handle the hardware aspect, the best thing to do is to do the digital to analog conversion outside of the computer. Many computers have S/PDIF jacks that will work with most DACs, and stand-alone DACs that plug into the computer's USB port are now plentiful and affordable. If moving your sound card around (I wouldn't recommend shorting the connectors myself) isn't producing any results, buying a USB DAC is the easiest and least expensive option.
If you fix the hardware and the problem persists, then it's likely to be a software problem. Unfortunately the sheer amount of possible software makes fixing that problem far more complicated.
One thing that I learned to do was to take an older PC and repurpose it for audio-only use. Instead of Windows, I use a specialized Linux distribution made especially for audio use. If you have an old PC handy, you might want to try a similar setup.