I have a Mac Mini that I use as my media computer and for doing Apple-related stuff (like synching my iPhone). This morning while listening to music in iTunes the playback suddenly stopped for no reason, then started again, and continued to repeat the start/stop process. It was like a phantom was randomly pressing the “Play” button on my keyboard (removing the batteries from my Bluetooth keyboard did not correct the problem). I restarted my Mac but as soon as I did iTunes started itself and proceeded to play the last tune I was listening to (and then stop, and play…).
After a number a diagnostic steps and some Google searching I finally figured out the problem. Last night I had set something down towards the back of my desk which was accidentally lying on the speaker cable coming out of the back of my Mac causing an intermittent connection. Apparently the intermittent connection was causing the Mac to receive unwanted play/stop messages. When I removed the object and plugged the cord firmly into the Mac the problem was solved.