My MacBook Pro (late 2013) whines when sound is triggered

Solution 1:

What you are hearing is either capacitor squeal, or coil noise.

Basically, it's just an audible sound of the electrons as they flow through components and they cause the nearby components to resonate enough to be audible.

Most of the time it's benign, but (obviously) can be really annoying. In the case of capacitors, however, it may also be a sign of an imminent (or recent) failure.

There's a good article describing this: Capacitor squeal & coil whine explained

Either way, if you are under warranty (for any device, not just Apple), you can get it resolved. Even if you are not under AppleCare, I would definately take it in and see what they can do for you.

If you cannot get Apple to service it, have a look at Rossman Computers out of NYC. He has been able to repair what Apple said couldn't be repaired. I am not affiliated with him in anyway, I am just a satisfied client.