My sound has a problem.

When I'm using itunes or quicktime, the sound stops, and does a strange noise, and sometimes when I'm headphones the sound stops and starts playing in the mac speakers.

Is this a hardware problem?

bad contact?