Yes, it is truth. This is well known in rural enviorements, pigs is a clear example of this. The reason are stated in this study by the Food and Agriculture Organization of the United nations:
The energy required for muscle activity in the live animal is obtained
from sugars (glycogen) in the muscle. In the healthy and well-rested
animal, the glycogen content of the muscle is high. After the animal
has been slaughtered, the glycogen in the muscle is converted into
lactic acid, and the muscle and carcass becomes firm (rigor mortis).
This lactic acid is necessary to produce meat, which is tasteful and
tender, of good keeping quality and good colour. If the animal is
stressed before and during slaughter, the glycogen is used up, and the
lactic acid level that develops in the meat after slaughter is
reduced. This will have serious adverse effects on meat quality
Spoilage of meat
It is necessary for animals to be stress and injury free during
operations prior to slaughter, so as not to unnecessarily deplete
muscle glycogen reserves. It is also important for animals to be well
rested during the 24-hour period before slaughter. This is in order to
allow for muscle glycogen to be replaced by the body as much as
possible (the exception being pigs, which should travel and be
slaughtered as stress free as possible but not rested for a prolonged
period prior to slaughter). It is important that the glycogen levels
in the muscles of the slaughtered carcass are as high as possible, to
develop the maximum level of lactic acid in the meat. This acid gives
meat an ideal pH level, measured after 24 hours after slaughter, of
6.2 or lower. The 24h (or ultimate) pH higher than 6.2 indicates that the animal was stressed, injured or diseased prior to slaughter.
This condition is called PSE (Pale, soft, exudative meat) which Wikipedia describes and explains it might be caused by stress prior to slaughter:
PSE meat, describes a carcass quality condition known to occur in both
pork and poultry. It is characterized by an abnormal color,
consistency, and water holding capacity, making the meat dry and
unattractive to consumers. The condition is believed to be caused by
abnormal muscle metabolism following slaughter, due to an altered rate
of glycolysis and a low pH within the muscle fibers. Genetic
predispositions and stress levels prior to slaughter are known to
affect the incidence of PSE meat.
Also it looks like there other studies about this which conclude :
The results of recent scientific studies on pork quality should have a
great impact on the entire swine industry from the producer to the
packer to the consumer. The stress placed on pigs can be lessened with
the proper management practices, which increases meat quality and
benefits everyone