For capturing the sound, you could take a look at
the source code for Audacity[
^] to see how it does it (Audacity can record from the sound card, although I think that option might depend on the sound card in use).
However it sounds to me as if you want to do something similar to what (optionally)
some remote desktop applications[
^] do. If you take a look at those listed as having audio support (in the "Features" table near the end of the document), some of them
might have associated source code, or specify the protocol that they use.
(e.g. the one I've used, UltraVNC[^] uses the RBF protocol[^], but unfortunately that does not support sound. Some of the others that do support sound may similarly have source available or reference protocols, etc).
Just an idea :)
Regards,
Ian.