Chosen Solution
Over the past few weeks, I’ve noticed that my MacBook Core 2 Duo has developed a high-pitched squealing noise. It almost sounds like a high pitched record scratch with a variable frequency. It sounds like it’s coming from the back right side of the machine, near the power button and right side speaker. It seems if I tap the case hard enough in this area, it will temporarily stop, but it comes back fairly soon. It will also go for quite long periods without making the noise. Volume controls and mute don’t affect the noise at all, and it will happen whether or not headphones are plugged in. Music and other audio plays out of both speaker and headphones with no issues. Performance and functionality of the machine don’t seem to be affected. This is a pretty old machine that I’ve taken apart and put back together a TON of times for various reasons (fan, display inverter, LCD, bezel, keyboard/trackpad cable, hard drive, etc), so I wouldn’t be surprised if some other component has started to go bad. My first impulse was going to be disconnecting the speakers to see if the sound would go away, but I thought I’d get input from the folks here first. Thanks!
If not what Dylan said, it could be a loose internal fan, hitting the sides. Or even dust blocking it.
It could be coil wine, look up a video to hear what coil whine sounds like.
Does the sound change if you insert a disc into the optical drive? That is a noisy component which spins and is located near the area you are describing. If so you may have a faulty optical drive.