I have an electric keyboard which has pretty good-sounding output. It has two headphone jacks which provide the same output which sounds good with my headphones. I wanted to record the output so I got this male-to-male audio cable and connected one of the jacks to the red jack in my computer's sound card. I managed to set it up and get a recording, but the result is quite noisy: see here for an example. Essentially there's a lot of background noise, and that's after I applied the noise reduction in WavePad. (Here is the pre-noise-reduction one.)
How do I get the recording to have less noise in it? There is no noise if I plug my headphones directly into the jack and I'd like the recorded output to be the same.
Additional details as requested: I'm using the Yamaha P65. I'm using one of the 2 mini headphone jacks (3.5mm) as output. The soundcard model is the built-in soundcard for my motherboard whose model number escapes me, yet I will find a way to look it up if needed. The input socket is also 3.5mm audio input.