It needs to be directional. Sound waves are spherical, and spherical waves without common centers don't overlap nicely. So you can't produce a "localized cancellation field". You can only put something very close to your ear and cancel things aiming inwards, because that's unidirectional.
Your microphone and your speakers need to have a known distance between them, and it cannot be off by an appreciable fraction of the wavelength of sound you are trying to cancel.
Consider the buzz of your air-conditioner. It's emitting, say, 10KHz. (We're talking spherical cows here.)
Speed of sound is 343 m/s. So you can pack 10K waves into 343 meters. That's 0.0343 meters wavelength = approx 3 cm.
So your microphone must read the wavelength and create an exact opposite-magnitude wave that lines up with it perfectly.
That means it needs to know how far its microphone and speaker are from each other (so it can adjust for the wave travel time), and the relative direction.
I don't know much about the science of acoustics, but from reading the wikipedia article on Noise-Cancellation, it seems like you would need the speakers to be right next to your ears (i.e. earphones) in order for this to work, so that each ear could get the correct (and distinct) anti-noise pattern.
So, if your goal is to not need to wear earphones, I think you might be out of luck.
You probably can't do this using a computer. To do noise cancelling you need a really short delay in between receiving the signal and getting the speakers to counteract it. The latency introduced by the PC would almost certainly be too much. Existing noise cancelling devices use fast DSP for this.