For as long as we’ve been able to transmit sound through the ether, it seems, someone has been listening in.

This has perhaps never been quite so prominent as it is now in our current consumer climate, in which auditory surveillance is a valuable commodity. Companies like Amazon, Google, and Apple have infiltrated our lives not by force or secrecy, but through glossy advertising and the promise of efficiency. We ask Alexa to dim the lights, Siri to tell us the weather, or Google Home to play the new Lizzo album. In order for these devices to do this, they have to be able to hear us. And in order for them to hear us, they have to always be listening.

But we weren’t always so welcoming of such auditory invasions. Indeed, these devices – disguised by shiny bezels and colourful lights – are a far cry from the sorts of covert listening technologies we’re used to seeing in spy films or television thrillers. Auditory surveillance was the stuff of Cold War espionage and nefarious governments – not consumer convenience. And yet the history of auditory surveillance is intertwined with one of our greatest sources of pleasure and entertainment. Music – specifically, the technologies we use to create, share, and listen to it – has been integral to the development of devices that let governments, other people and companies eavesdrop.

The era of commercial telephony began when Thomas Edison, who had invented the phonograph just a year prior, telephoned from his home in Menlo Park, New Jersey, to Philadelphia in 1878. Not long after that, curious hobbyists and devoted inventors alike experimented with singing songs and playing music from afar. With telephony, however, came a new set of social and cultural expectations, listening contexts, and potential risks. Over the next decade, phone tapping – listening in to conversations live – was not uncommon, and it was not long until clandestine microphones (“bugs”) began to appear. In 1892, New York state made the intrusion a felony, and other states soon followed suit.

As the world descended into conflict in 1914, engineers used similar techniques and borrowed from telegraphy, too, to listen for German U-boats aboard British naval ships. Their methods for “enhanced listening” enabled the British to “see” the enemy via sound. By the Second World War, radar (“radio detection and ranging”) and sonar (“sound navigation ranging”) expanded these electroacoustic techniques to detect foreign objects and enemy ships.

To counter these methods, actress Hedy Lamarr teamed up with composer George Antheil to develop the technique of “frequency hopping,” which prevented enemy submarines and ships from detecting American torpedoes. The two artists built on ideas of melodic change with their invention. While the US government never used their technology, it laid the foundation for the development of Wi-Fi technology. The same technology that at the turn of the century had been used to transmit jazz and cabaret tunes to listeners around the world had been adapted, transformed and militarised.

With the end of World War II came another global conflict: the battle for political and ideological supremacy between the United States and the Soviet Union. Fought as much by analysts as it was by soldiers, the Cold War became a flashpoint in the global development of auditory surveillance. The CIA, as one recently declassified document shows, saw such surveillance as key to the United States’ mission for global supremacy. But the CIA document also acknowledges that the United States lagged far behind its Soviet nemeses well into the 1950s. More than 100 covert listening devices, the report claims, were found in overseas embassies and consulates in the first few months of 1956 alone. In the battle for information, the US was on the verge of losing.

The CIA, it seems, relied on tried and tested techniques of spycraft when it came to planting bugs – though, from time to time, it resorted to more unorthodox methods like training birds and cats to plant listening devices. The Soviets, on the other hand, spent much of the 1940s and 1950s developing new technologies that would make it easier to install and monitor devices.

The most famous – and most effective – of these was “The Thing”. Planted in the Great Seal of the United States in the Moscow Embassy in 1945, “The Thing” was one of the first covert listening devices to not require any external power source. Instead, it was a “passive” device, which meant that it was triggered by an external radio signal. In turn, a small membrane vibrated according to voices in the US ambassador’s office, which were then retransmitted to the external radio receiver. Its small size, lack of a power source, and long operational life made it nearly impossible to detect.

Its inventor was, at least for much of his life, one of the most famous Soviet engineers – and someone deeply invested in music. Lev Termen had gained international renown in the late 1910s with the “termenvox,” an electronic musical instrument that was controlled exclusively by a performer’s manipulation of radio signals in the air. Known more commonly as the theremin, the instrument was played without ever being touched by a performer. It quickly became an international sensation, a seemingly “magic” technology of the future, and Termen demonstrated his instrument around the world. Its spooky, oscillating timbre made it well-suited for movie soundtracks, and it was particularly often used in horror and science fiction films. Composer Bernard Hermann, who was best known for his work with Alfred Hitchcock, used the instrument extensively in the soundtrack for The Day the Earth Stood Still (1951), and the Beach Boys most famously emulated the sound of the instrument in their song “Good Vibrations,” from 1966.

After returning to the Soviet Union after a long stint in the United States, Termen was imprisoned in 1938 and placed in a sharashka: a type of labour camp in which imprisoned scientists, researchers, and engineers were put to work for the Soviet military. Termen would spend nearly 10 years there, during which time he used the same technological principles of the theremin to create “The Thing.” Released only in 1947 – after being awarded a Stalin Prize for his invention – Termen worked for the KGB until 1966. During his tenure, the “Soviet Faust” helped to engineer a wide variety of technologies for espionage.

The connection between military operations and electronic musical media is a long-standing one. Tape recorders brought to the United States from Germany after the Second World War would enable composers and musicians like John Cage, Pauline Oliveros, and Les Paul to experiment with new musical sounds. Electronic music studios in the Cold War became important sites for the negotiation of cultural memory and ideological beliefs through music. Germany, too, repurposed its military resources by turning propaganda radio stations into sites for musical experimentation. And the earliest examples of computer music in the United States occurred in tandem with the expansion of military intelligence organisations; one software engineer on the West Coast recalled, “The same [software] can be used equivalently without any modifications whatsoever to either help make bombs or help make music.”

Termen realised this, as did the Soviet government. The YS only tuned in some years later; it wasn’t until 1952 that the US ambassador to the Soviet Union, George Kennan, would find the bug.

Upon his retirement from the KGB, Termen went straight to working as an employee of the Moscow Conservatory. Once there, he took the skills he had developed over nearly two decades of work in sonic espionage to once again create experimental electronic musical instruments. In Termen’s work, the musical and the martial converged. Whether his technologies would be used for creation or detection depended on time, place and intention.

This distinction between music and warfare, between entertainment and surveillance, is key to helping us understand the proliferation of digital assistants today. Over the course of the 20th century, ordinary consumers excitedly welcomed devices like the radio and phonograph into their homes. Such demand spurred further research and development of these technologies. Progress geared to the consumer, the narrative goes, was progress for society. But at the same time, this research had a dark underside, one inextricably linked with military conquest and global surveillance networks.

Seduced by the promise of ease, efficiency and entertainment, we invite devices like Echo and Google Home to listen in on our everyday lives – and it’s our choice to do so. But it’s important to bear in mind that as we do this, we further the connections between entertainment and surveillance capitalism, a system in which our Hulu binges are linked to our Spotify playlists, which in turn influence the advertisements we see while scrolling through Facebook. The use of musical media in the service of auditory surveillance is nothing new, yes, but for the first time in history, we’re gladly welcoming it into our homes as part of a broader, intractable entertainment ecosystem.

For as long as we’ve been able to transmit sound through the ether, it seems, someone has been listening in. It’s time to pause quietly and ask ourselves: What do we – and don’t we – want them to hear?

This piece was originally published on Future Tense, a partnership between Slate magazine, Arizona State University, and New America.