Does it happen in only one thing? (cd player, stereo, walkman, computer) If it is only happening in one device, then you can blame that as your problem.
I think it may be that the male end of the headphone jack just isn't making any good solid connection with the female end (Male=stick, Female=Hole) I think there are things out there that can help make a better connection, but generally you are just better off getting something new.
It could also be the wire. If it gets tugged on a lot, then it might not have a solid path.
Thats about all i know
