whirlpool making loud vibrating noise when spinning

when my washer is spinning it is vibrating badly. I was told it could be a baring or I may have to replace the tub and all?