It's for doggo when outside.
Discussion
Ah I see, then I would resort to basic crate training, if that's an option. Just to get your doggo, to learn "Oh shit each time I bark I get sent to my crate."
Of course the bark is an early warning system for us, but if it's not fulfilling that role, then I think all dogs can learn the difference with enough training.