The boatswain's whistle (pronounced bosun's whistle) is a small whistle that was used aboard old sailing ships since the 15th century, usually to gain the attention of the crew, and was still used on starships up to the 24th century.
Aboard starships into the 24th century, it was normally used when an honorary guest comes aboard or at a crewmember's funeral, when their body was released into space. The shrill whistle was often played before a ship-wide or open frequency communication, usually made by the captain or another senior officer. (TNG: "Booby Trap", "Yesterday's Enterprise") The actual tone of the call has varied, as some captains preferred the distinctive notes of the electronic type over the more traditional metal whistle. (TNG: "Lower Decks")