Both. The equation I use is
where v is the speed of sound. It accounts for the movement of both the source and the detector (object). Remember that what matters is the movement of the source relative to the observer/detector. If the detector is moving towards a stationary source, the effect on the frequency of the sound emitted is the same as if the source were moving towards a stationary detector at the same speed.