Contact Apple Service, iMac Service or Apple's Express Lane. Do note that if you have AppleCare's protection plan and you're within 50 miles (80 KM) of an Apple repair station, you might be eligible for onsite repair since yours is a desktop machine (depends on where you're located). BTW, the AppleCare Protection Plan's the best warranty policy available for desktop machines. Get it if you don't have it before contacting Apple.
Noticed that you have a very similar issue to mine. I've got a 27" iMac, 3.4Ghz, 32Gb RAM, 680MX 2Gb, 3TB Fusion and when I'm playing Blizzard's Diablo III or StarCraft 2 I get a buzzing sound eminating from the lower right area of the machine. It varies in level depending on what is going on in the game, but even at the lowest setting and in the game's menu itself it still makes the same noise.
Rang Apple, ran the game during the phone call, turned off all sound, and even their support guy could hear that it was an issue. The iMac has since been taken into a repairer and has been there for 9 days now with no information on how much longer it'll take.
Were you able to fix your problem?
Nope, the issue was not able to be fixed. I had the Apple Store replace the iMac for me, and the new one is much, much quieter. If I put my ear to the back of the computer I can hear the buzzing still, when gaming, but not at normal seating distance or across the room like I could on the original system.
This might seem a strange answer, but it has fixed this fault on my 27" two year old iMac (at least for a few days now, will be monitoring).
I had this very fault suddenly develop last week. It was consistent, the noise increased with screen brightness, but was also present with the screen asleep.
I looked at every forum on the subject, became almost convinced my fans weren't controlling properly as well.
I decided it was the switched mode power supply, discussed repair options with my local Apple Store.
Checked the household mains voltage - I'm in the UK, it was slightly low at 236v AC, but thats acceptable.
We have a garden full of water features and LED lighting.
I just decided to check all our power junction boxes that supply power to various pumps and lighting.
I found one of the boxes full of water, with the Live, Neutral and Earth, and the 12v DC cables all under water and shorted together. The terminals were all corroded and burnt.
Yet, I had no faults present in the garden, everything was running normally. And the RCD breaker had not tripped.
I repaired the box, fitted new terminals and rewired the box.
And since I did that, my Mac has cured itself.
I've had it running for hours to get hot, no noise, gone completely.
And the mains voltage now measures 242v AC (should be a nominal 240).
The RCD did not trip because, with all the cables shorted in water, there would no out of balance condition to initiate a trip.
So, I can only assume that arcing or the short was causing some harmonics on our mains supply that was been picked up by the coils in the Mac power supply.
The 12v DC supply in the junction box was also supplied by a switched mode supply. I dont understand why something didnt blow in the garden, but it didnt.
I'm monitoring the Mac as the solution just seems unrelated.
Oh, and I noticed our Intruder Alarm panel was humming loudly and now it isn't.
So, I would suggest anyone with this issue takes note of any unusual humming or buzzing in any other electrical item within the house, or outside. It may indicate you have an issue elsewhere.
Even any loose mains plugs in equiment could be causing a slight arcing on the contacts, causing noise on the mains that may be getting picked up.
Coming from an interest in high-end analogue Hi-Fi, amplifiers always performed better with a dedicated, clean, mains supply, usually from a 40 amp rated cable fed direct from your electricity meter to supply your Hi-Fi.
The amplifiers would exhibit less noise and a cleaner sound with more detail. And the transformers in the power supply were a lot quieter too.
And what do we have today - ethernet tranducers plugged into household sockets, superimposing high frequency signals onto the household wiring.
They would cause havoc with top-end amplifiers, I'm sure.
I hope this is the solution, saves me an expensive repair.
I've never had any problems with the six Macs I've owned in the last 12 years.
Thanks for that extensive response, Mike. It ended up going in for repair (Next Byte, Glenunga, Australia) where they were able to verify that it had a problem. That took them a week just to verify it. Meanwhile they didn't lodge the fault with Apple and after a fortnight I was getting irritated about the amount of time they were taking to fix it. Rather than ringing them I rang Apple who weren't aware of the case. Once they got involved it was a quick turnaround.
HOWEVER, it came back with extensive damages to the side. It was like they pried the screen off with a screwdriver or something. It was horrible. That and the insides weren't in the right spot. They were about 1mm out of line which meant that the fixed port holes in the back didn't line up with what they were being connected to in the machine. This meant I couldn't plug anything into it without extreme force. Another phone call to Apple and the whole thing was replaced.
It was a horrible experience. I'll never do business with Next Byte again. Hopeless with no apology. We've since had an Apple Store open up in our town and any future issues will go straight to them. Still don't know exactly what was wrong with it.
Having said that issues have been rare. I had the hard drive replaced in their Seagate HDD Replacement Program for a previous Mac, but that's about it for around about 10 years of ownership.