"Fish do in fact fart, but the purpose of their farts encompass more than simply releasing gaseous waste of intestinal bacteria as in other animals.
Herring have been documented to emit a "raspberry" sound in association with releasing bubbles from their anus. This sound, may actually be important in communication, especially after dark. It may possibly function to help fish locate one another while schooling, although the details of the mechanism are unknown. This idea is supported by increased farting when more fish are present, it occurs mostly after dark, and herring can hear sounds of this frequency. Some scientists also suggest this farting may be important in predator avoidance, as it occurs at a frequency the herring, but most marine mammal predators cannot hear.
Herring belong to the order Clupeiformes. These fish possess swim bladders, gas filled sacs, that attach to the gut via a duct near the esophagus. This order also has a duct permitting air flow from the swim bladder to the anus possibly permitting bubble stream release. Thus, although fart-like these farts are not byproducts of digestion."