Rattle

Im getting a rattling sound when I turm on window defrost and AC, but only with engine on. If just accessory, no rattle. Could it be compressor??