Connecting a telephone to the computer's soundcard to playback music samples while talking
Not so hard I've built that before :)  Long time ago though.   Anyway first you can buy things like this if you want.  Here's one that's not cheap but pre - built.

http://www.jkaudio.com/voice-path.htm

If you want to do it yourself you just need a hybrid transformer and a few parts.  Check out this website it has a couple of schematics that will do the job.  Especially look at the one titled "Recording interface from Tekniikan Maailma magazine"

http://hackipedia.org/Protocols/Telephone,%20POTS/html/teleinterface.html