Can you have a device which upon detecting the frequency emits some kind of counter vibration that cancels out th attack?
Normally sounds don't change in frequency that often so that's good enough (tm). I can hear myself typing now (short burst of sound), but the washing machine nearby, which is louder without earphones, is completely gone.
And that match depends on matching frequency and distance - or having a very fast tuning system, and then you've got to do all this in a device that's not just another LRAD (at which point you're back to "the best defense is a good offense").