Dog barking

I've had my rescue dog for almost 4 years. He's a StaffyxLab around 9 years old and has trouble with strangers and other animals due to trauma.

My problem lately is ever since my daughter has been born hes been more vocal. I think he's just protective of the house because he's fine on walks. He will bark at the quietest sounds and it's getting too much for our neighbours.

Indoors he barks if he can hear people on the street, or car doors down the road, or slight knocking sounds. I often miss parcels because he's barking so loudly before they even knock I can't hear them and he barks so frequently at random sounds I don't always check the door. When we let him into the garden to do his business, he will usually run out full force and bark at nothing (trees moving in the breeze, etc) - we also have seagulls living on our roof in the summer, and cows in the field behind us that he likes to bark at. To be fair there's also other dogs down the street that bark from time to time, but nowhere near as much as him.

He's my first dog (he belonged to my partner for years before) so I've never experienced it before. My partner's method is to say "Stop" and if he doesn't, then to smack his nose and firmly say "No", but he will continue. This has been his method for years and nothing has changed. If anything its taught our daughter to slap at us or the dog which is a whole other issue (he's great with her and it doesn't bother him at all).

We tried a sonic noise machine that you plug into an outlet and it let's out a sound when he barks, but either it didn't work or he didn't care, because he didn't respond at all. I think the neighbours have one too because whenever I'm outside I can hear a super high frequency noise that gives me a headache, but it could be something different.

What other things can I try? Lately I've been holding him and "shhh"ing him because it stops him barking faster, but it doesn't stop him barking to begin with. If that makes sense? Also I'm worried it just encourages him to bark for attention.