The non-natural vertebrate group, commonly known as #fishes#, are mainly consisted by aquatic animals with branchial respiration and have all life cicles directly related to salt or freshwater environments (remember, all aquatic and terrestrial vertebrates are naturally and evolutionary modified forms derived from fishes too, from Sarcopterygian common ancestor).
So, as "fishes" lives inside water, they must control its body flotation (or relative density) by adding or expelling gas from swim bladder. But, how can they do that inside the water, #"IF"# the gas bladder has #"NO" # connections to the mouth in most species of fishes? (except from physostomous Actinopterygians and Australian, South American and African diversity of the only three living species of Dipnoii).
First of all, gas or swim bladder are related to fishes called "Osteichthyes". Osteichthyans (or bony fishes) are composed mainly by Sarcopterygians (Coelacanthe and related extinct forms of limbed fishes) and Actinopterygian (including the major diversity group on freshwater, the Ostariophysii, formed by Siluriformes, Characiformes, Gymnotiformes and Cypriniformes). One of the features of bony fishes is the possession of a chamber called swim bladder that encapsulates and store gas inside of it, regulating thus body densities as they want to explore different depths through water column.
How the gas are stored and expelled from the swim bladder? There's an important physiological process that drives the "transformation" of solved blood gases (#O_2 and N_2#) into expanded gases itself, inside the swim bladder. This process takes place on a special tissue called #"gas gland"#, adjacent to the swim bladder, perfused by a numerous tiny vessels (both arterial and venous). When this gland is acidified by physiological commands controlled by the central nervous system of the fish, this acidification leads to the dissociation of blood dissolved oxigen bonded to Hemoglobin, resulting in liberation of oxigen and nitrogen forms of expanded gases inside the swim bladder. The reverse process follows the opposite way, draining gases from the swim bladder into blood stream by turning the pH less acid.