If it's close to the ear canal, all you need is low latency hardware (or hardware+software), responding in a few milliseconds thereabouts.