A train whistle or air whistle (originally referred to as a steam trumpet) is an audible signaling device on a steam locomotive used to warn that the train is approaching, and to communicate with rail workers. Modern locomotives primarily use a powerful air horn instead of a whistle as an audible warning device. However, whistle continues to be used by railroaders in the context of audible signaling, such as "whistling off" when a train gets underway.
The need for a whistle on a locomotive exists because trains move on fixed rails and thus are uniquely susceptible to collision. This susceptibility is exacerbated by a train's enormous weight and inertia, which make it difficult to quickly stop when encountering an obstacle. Hence a means of warning others of the approach of a train from a distance is necessary, especially on high speed rail lines. As train whistles are inexpensive compared to other warning devices, the use of loud and distinct whistles became the preferred solution for railway operators.
Steam whistles were almost always actuated with a pull cord (or sometimes a lever) that permitted proportional (tracker) action, so that some form of "expression" could be put into the sound. Many locomotive operators would have their own style of blowing the whistle, and it was often apparent who was operating the locomotive by the sound. Modern locomotives often make use of a push button switch to operate the air horn, eliminating any possibility of altering the horn's volume or pitch.
John Holliday describes the history of train whistles as originating in 1832, by way of a stationmaster at the Leicester and Swannington Railway opening, who suggested that the trains should have an audible signaling device. A local musical instrument builder was commissioned to provide a steam-powered whistle, then known as a "steam trumpet".
The article also describes a train collision with a cart, wherein the train used a horn blown by the driver (as steam whistles had not yet been invented). One account states that Weatherburn, the engine driver, had "mouthblown his horn" at the crossing in an attempt to prevent the accident, but that no attention had been paid to this audible warning, perhaps because it had not been heard. Although nobody was injured, the accident was deemed serious enough to warrant George Stephenson’s personal intervention. Stephenson subsequently called a meeting of directors and accepted the suggestion of the company manager, Ashlin Bagster, that a horn or whistle which could be activated by steam should be constructed and fixed to the locomotives. Stephenson later visited a musical instrument maker in Duke Street in Leicester, who, on Stephenson's instructions, constructed a "steam trumpet", which was tested in the presence of the Board of Directors ten days later.