My sound sucks!

Everytime I try to listen to music or watch a youtbe or anything that makes sound on my computer, it sometimes will run normally but it always slows right down making these static kinda shock noises it runs so slow. Here is my computer info. I think I need some more RAM.
Processor: Compaq Persario Intel (R) Celeron (R) CPU 2.53GHz 504MB of RAM
Sound system: Realtek AC 97 sound system
Processor: Compaq Persario Intel (R) Celeron (R) CPU 2.53GHz 504MB of RAM
Sound system: Realtek AC 97 sound system