The high-pitched tone emitted by these type units elicits a strong orienting response in the dog, which momentarily distracts him from whatever (or nothing) he was barking at. From my own experience as well as from what I've heard from others, these units may discourage barking in the short term, but they really don't work for chronic barkers. The dog gets habituated to the tone and ignores it after a while.
I have two such units, one for outdoors, which senses sound waves and emits the tone automatically, and a handheld unit with a button. I rarely use either of them. Usually what happens when the dog hears the tone for the first time is that they perk up their ears and look around for where the sound is coming from. The second time they hear it, some dogs ignore it and others act like it hurts their ears. So it does interrupt the barking for a moment, and may discourage some dogs from nuisance barking, and if you have $40 to gamble it might be worth a try. But I can't really vouch for these units.