Ac compressor squeals when ac is not on but is quiet when ac is on?

it is probably the bearings going out in the ac compressor pulley or belt slippage. the reason it is different when it is on is because the belt is not under "load" or has resistance.