The shouting, called kiai, has multiple purported purposes. I would note that I'm posting these not out of a necessary belief in them, but out of explanation as they were taught to me:
- The forced and trained rapid exhalation of breath. This can be used as both focus (by focusing on breath, one is less inclined to focus on the fear of failure when faced with the thought of breaking something apparently hard), and as a method of rapidly exhaling carbon-dioxide from the body to increase oxygenated blood flow to the extremities.
- The external (outer or omote) harmonizing of ki energy (気合 - kiai), as opposed to the internal (inner or ura) harmonization of ki energy (合気 - aiki). [NB: This is not something I believe, so this is best left to someone else to explain familiar with the concepts.]
- The expulsion of intent. Kiai acts as a declaration of your fighting spirit, your internal desire to prevail in those circumstances. This can be for intimidation, self-reassurance, rallying (the war cry was essentially a form of kiai), etc.
Something that many people may never learn: the kiai need not be loud. In some arts, the kiai is taught as a voiceless projection, called kage no kiai.
In addition, some arts offer specific forms of kiai, for example (from the Bujinkan; I have no record from which school, I simply have it in my notebook as kihon): [Suggestion: "kihon" is a fundamental exercise; in my brief experience with Shindo Muso Ryo Jodo, we usedbut the proper term "kotodama" to refer to these kiai]is more likely kotodama)
ei! - A growling shout, meant to accompany an attack; intended to force the opponent to lower his guard momentarily.
toh! - A heavy shout, meant to accompany a counter; intended to make the opponent believe he has left an opening.
ya! - A boisterous shout, meant to respond to a series of blows; intended to dishearten the opponent, making him believe that you believe you're already victorious (may tie in to folk beliefs that a battle is decided the moment two adversaries first see each other).
It's said the kage no kiai taught in the Bujinkan is a harmony of these three shouts, voiceless or in a low hum, assuring the warrior of victory. This might be viewed as a form of self-assurance, helping to maintain a form of inner calm or mushin.