How does web streaming of terrestrial radio work?

27 views
0

I understand that most of the internet works when my computer or phone, via a browser or app, requests a specific download of files. I imagine this is how streaming radio like Spotify works: my device is temporarily downloading the audio file. But how does it work when there is a constant stream of programming that many thousands of devices are simultaneously streaming?

In: 1

The server does basically the same thing as when sending a static file, it’s just producing the packets of the file from memory in real time rather than reading it from a disk. Basically, your device is downloading little bits of content and generally does so faster than you listen/watch them, so it can seamlessly switch playback from one to the next.

Both Spotify and an internet radio (that has a never-ending programming) are downloading audio data in little parts, saving them temporarily, “building” block by block some seconds of audio.

Whenever they detect that they downloaded and built a useful amount of audio (let’s say 5 seconds), the player plays the audio so you can listen.

If your internet speed allows it, it will download more and prepare it for you in advance.

If it supports the feature, it will save the previous blocks of audio so you can scroll around and hear again the previous parts without re-downloading, like a normal Youtube video or Spotify.

Others will just delete and discard the previous bits.

So there it is. You don’t really need a clearly defined file (like a song) to stream. You just need seconds of audio, whatever happens to those seconds of audio after being played (like being saved afterwards to a song file, saved temporarily to be scrolled, discarded) is up to the player app 🙂