Whining sound when accelerating

Does the whining sound chenge with the gear changes? Does it seem to be following the engine speed or the speed of the vehicle? Does it seem to be coming from the tranny, the engine, or the chassis?

And lastly, if you pop the hood and accelerate the engine manually (or have a friend push the gas pedal) can you hear the whining under the hood?