Is there a way to get the sound that the sound card is playing directly from the hardware?
some sound cars can select the output sound as mic, if that is acceptable then you could just google how to use the microphone...
I presume that this is Windows since you are using C#. Ignore this if you are using mono.
There is no officially supported way to do this in Windows. Some sound cards have a setting in the mixer that will set the wave record input to 'what you hear'. So on those cards, you could just set that setting and then record audio.
edit:
I should add that if your driver doesn't have built in support for recording what it's outputing, then you will need to write or purchase a driver that does. I've heard that TotalRecorder can do this.
NAudio is a nice API for sound programming in C#. I'm only discovered it myself, but it might be able to record the output, though probably not...