I'm sure there's a simple solution but almost daily, when I'm online or working on other programs. A humming sound will begin and gradually get louder. It only stops when I shut the laptop. Thoughts?
Do you notice it regardless of what app you are using? I have seen this kind of thing before with various audio drivers.
If you can pin point it down to one location/area on the computer you might think about taking it in for diagnostics to an Apple Store or AASP.
If it is software related, try keeping an eye on Activity Monitor when it is getting close to the time-frame of the sound and see if you notice any processes starting up that use a hight CPU% or apps that simply stop responding.
Take a tube of arms length and hold one end at your ear, and locate the precise place where the hum is sourced.
Take care to listen to the display (front and back) since it could easily be the power inverter to drive the lcd. Once you've isolated the where, it will be a very quick call to Apple to determine the part affected and the warranty status.
Also, don't overlook it could be the speaker system even if you don't expect noise from it.