As the air is compressed, volume decreases so work is done on a mass element, its energy and hence temperature goes up. If it flows at nearly constant P and cools its density increases (v decreases) so it slows down for same mass flow rate
and flow area.