Whale song was a form of communication made by the male humpback whale of Earth. The male humpback would sing his song anywhere from six to as long as thirty minutes and then start again. In the ocean, other whales picked up his song and pass it on. The songs changed every year, and until the 23rd century, served an unknown purpose. Long speculated as some sort of navigational signal or as part of a mating ritual, the truth behind the whale song was not determined until long after their extinction.
In 2286, an unknown alien probe entered the Sol system emitting a high frequency transmission, focused on Earth's oceans. It was later determined that the probe's transmissions were, in fact, whale song. (Star Trek IV: The Voyage Home)