No, it is better to train the dog to not bark unnecessarily. You can easily do this by training your dog to stay calm.