This is my question.
I don't know why the people just vote down without comments. Is it a really bad question?
I think it's a perfectly fine question. As the answers have shown, it's not something which is trivially answered from the rule book. I don't understand why it received down votes, although I'm happy to note that it now has a positive score.
One potential improvement I'd suggest is to specify which rules you care about; there are non-trivial differences between the FIBA, NBA and other rule books.
Most likely from the title: "Is shouting a foul in basketball?"
Of course not, the court isn't a public library or something. Even in your question you don't do much better to clarify. We can only assume something like this happened:
In the act of shooting the ball, someone suddenly shouted intent to mess up your shot / distract / scare you .. like, "BOO!" or something.
You do say that the person defending you was the one shouting, so that's good.
You could have been talking any number of different things.. like, an opposing player barking at a team mate to contest your shot, or boxout for the rebound, etc.
Why didn't you just ask the ref/officiating? Or was it just a pickup game? If it was a pickup game then how should we know?
Or were you asking if this would be a foul in the NBA/FIBA/AAU/NCAA? Maybe prison rules?
So there's the title and your question isn't clear on what you're asking. Doesn't seem like you put much thought or effort into the question either.
It's also potentially something you could have just Google'd on your own
The wording on the original question was even worse, looks like some people cleaned it up quite a bit.