Normally, 'whine' from a DC loco is when it is on a DCC powered track..
The DCC track 'supply' carries the data, as well as the power to the loco's.. A SINGLE DC loco can be controlled by using address '0'.. The Central Station then slews the centre-point of the 'square-wave' power to the track away from '0' volts, so as to mimic a DC voltage for the analogue loco..
The whine (or buzz / whistle) is the motor windings 'vibrating' at the signal frequency of the DCC signal.
To an 'engineers' ear, this is not nice! - Not kind to the motor / loco either IMHO..
Don't leave an analogue loco on the track for any length of time if you are not running it, and limit the running time as well.