A whistle, train whistle, steam whistle, or air whistle, (originally referred to as a steam trumpet), is an audible signaling device, or warning device used on a steam locomotive which is used to warn that the train is approaching, and to communicate with rail workers.The actual sound of a steam locomotive's whistle, is generated by an extra amount of steam which pumps to wherever the whistle is located. Similar to a sand dome or steam dome.
Because trains generally have extremely high mass and relatively low brake friction, they are inherently difficult to stop at normal speeds. Since train whistles were extremely inexpensive to institute compared to other more effective warning devices, the use of loud and distinct train whistles had become the preferred safety fallback for railway or railroad operators.
They are used exactly like with horns on diesel locomotives.
There are also different "tunes" or "tones" of which a whistle can sound, as well as different arrangements by having multiple whistles connected together.