I had this exact same problem in 2014 and it became a big problem because the buzzing became too loud that even on 3 to 5 bars of volume the buzzing is on full blast and i can't hear anything else.
So I had it checked here on an apple service, i live in the Philippines so we don't have apple stores here but we have PowerMac which a licensed apple store reseller and service.
So they said it was a hardware problem, so they replaced the speakers with a brand new one from singapore? or somewhere in asia so it took them a month to install it. So as a student I didn't have my laptop to use for my projects and everything. So after a month I got my macbook pro and we tested the speakers and it was working fine so they gave ma a 30 day (or was it 90) warranty for the speakers installed.
so i tested every time i use my mac I play music, videos, sometimes in max volume or just minimum depends on the file. So the testing went on for almost a week and then BOOM the buzzing starts to happen again. So I took it back and then when my macbook arrived i tested it for a day playing the same things then OKAY it happened again. then this went on for 2 more visits. Then me and my mom demanded a macbook replacement because they don't know what was the problem and it was causing me hassle because of school so we contacted Apple Singapore, and even tho we had no more warranty they granted a replacement of my macbook coming from Singapore.
So now Im using my 2nd macbook pro retina 13 inch!
So since then no buzzing sound from my speakers .......
UNTIL NOW. IT JUST HAPPENED THIS MONTH.
SO I DON'T KNOW IF IT'S A SOFTWARE PROBLEM SINCE APPLE KEEPS THEIR IOS UPDATED FREQUENTLY OR IS IT JUST BECAUSE THE PARTS THEY USE FOR THE SPEAKERS ARE DEFECTIVE?
but the buzzing is there when the volume is cranked up or the video that im watching is very loud.
So now I usually use a 3rd party speakers because I don't want to damage the speakers and have to wait a month to replace it and just get it worse like my first laptop.
the buzzing now is bearable unlike last time.
So I'm also seeking answers to this problem because they said it was hardware problem so meaning Apple is ripping us off with cheap inside parts???? :/ I hope not because I thought I was just very unlucky that I get the defective macs but apparently Im not alone.
Any say in this?