Bark Buster is something you may not hear, but your dog will.
AND will find highly irritating.
As irritating as you find unprovoked barking.
Dog barks, dog hears annoying noise, and associates it with barking behaviour, dog STFUs.
Everyone is happy.
The sonic pulse is inaudible to humans, and harmless to dogs.
Bark Buster is a handy fit in your palm (12.1cm by 3.8cm by 2.5cm 4.75 by 1.5 by 1 in), so ideal if the problem is when out walking.
Is water resistant, so can be set up in a problem area like a porch. And is wall mountable, and comes with a freestanding stand for flexibility.
Works using a 9 volt battery