How to record desktop sound?

Some of my songs are corrupted somehow and will play through the Windows 8 music player but not through iTunes. I want them on my iPhone but iTunes won't recognise them and converting them doesn't work either. I tried using Audacity and Wavosaur to record the songs and turn them into working MP3's but I can't get them to record through the desktop, only through the microphone which gives horrible quality. Is there any way to record the music directly from my desktop, not through the mic?

Use stereomixplus
http://stereomixplus.com/

You can record form
mic - the microphone input
wave - the cdrom drive
stereomix - the mixer.

open up your VOLUME mixer and choose what you want to record

don't forget to MUTE the MIC

Put one of the files into audacity and export it. Shouldn't be any recording involved.

So find a song file that works in windows 8 media player and drag/drop it into audacity. Then go to file>export… And click save anywhere you want. This will make a WAV file and you can play this in audacity. If this still doesn't work then something is wrong with itunes or the file.

Right click on speaker icon in task bar_open recording, right click anywhere in box on white space, click show disabled devices, stereo mix should appear,
Right click it and enable. Now open sound Recorder in-programme-accessories and start recording