Recording model train's sound output
The LokSound micro V4.0 has a "Class D last stage amplifier with a power output of 3 Watts" into 4 &ohm;, probably with BTL ('bridge-tied load') output. For 3 W into 4 &ohm; the rms voltage would be ~3.5 volts. That can easily be divided down to the 1 Vrms or lower required by the computer's LINE input jack.

However the signal first has to be converted from balanced to unbalanced, and it has to be isolated from the sound decoder and DCC track voltages. DCC power is +- 12 V, with the reversals encoding a digital control signal via pulse widths of 58 and 100 uS. This could induce a lot of noise into the signal if the balanced to unbalanced conversion is not done right. 

The simplest solution is probably a high impedance audio transformer, perhaps with a low pass filter ahead of it to smooth the class D waveform (normally this occurs inside the speaker, so the amplifier may not have an output filter). The circuit could look something like this:-







simulate this circuit &ndash; Schematic created using CircuitLab

R1-4 in series with R5 divides the input voltage by 4.8 to produce a maximum input level at the transformer of ~0.7 V rms (slightly less than 0 dBm into 600 &ohm;). The transformer is a standard 600 &ohm; line transformer like the Bourns LM-NP-1001-B1L, typically used in analog MODEMS and FAX machines. These are designed for operation at 300 Hz ~ 10 Khz and normally have poor low frequency response, but with the higher impedance load of the sound card's LINE input it should go below 100 Hz. A high fidelity audio transformer such as the Vigortronix VTX-101-007 would work better, but they tend to be more expensive and harder to obtain (depending on where you live, perhaps even impossible right now).       

Capacitors C1 and C2 make a 2 pole RC low pass filter with cutoff at ~10 Khz. Hopefully attenuation at the (unknown) class D switching frequency will be enough to remove any interference it might cause.