WWW FAQs: What is streaming audio?

2007-05-30: Streaming audio is audio (speech, music, et cetera) that plays back as it is downloaded. In other words, when you click on the link to hear the song, the song starts playing right away - or at least before the entire song has been sent to your computer.

Streaming playback was invented to solve a problem: downloading an entire song or album takes time, and users get tired of waiting. Early web browsers always played music in "external player" programs - and they always downloaded the entire file before launching those programs. So there was nothing to do in the meantime except wait!

Early audio players, like the first versions of the RealAudio Player, worked around this problem by using "metafiles." Rather than linking directly to the actual audio file, a website would link to a special "metafile." These were simply text files containing the URLs of one or more audio files. When the user clicked on the link to the metafile, the web browser would launch the external player program and hand it the tiny metafile - at which point the external player would open the first URL in the text file and start streaming the music.

For the most part, this technique is no longer necessary. Modern web browsers "hand over" the audio data to the player program as the data arrives, allowing the music to start playing much sooner. And many music websites use Flash-based music players, taking advantage of the built-in streaming features of Flash. However, .m3u files are still popular as a simple way to create a "playlist" that works with just about any player that can handle MP3 files.

Streaming Audio Problems

There's one big catch with streaming audio: your Internet connection has to be fast enough to keep up. Here's how it works: an MP3 audio stream requires a certain number of bytes per second. And if your Internet connection isn't at least that fast, it isn't possible to play the audio as it arrives without "stuttering."

Even if the user's Internet connection is fast enough, it is still possible for the web server's connection to be overwhelmed. Multiply the bytes per second for the MP3 file by 100 simultaneous listeners and you're looking at a lot of bytes!

But if the user's connection is fast enough, and the web server's connection is fast enough, then you're all set... right? Well, not quite. There's one more bottleneck: the Internet itself. With more and more people listening to streaming audio and watching streaming video, the "backbone" Internet connections that tie everything together can also become overwhelmed at times. This is why it is important to keep improving the infrastructure of the Internet.

For More Information

To learn how to embed streaming audio in your own web pages, see my article how do I embed sound and music in a web page?

Legal Note: yes, you may use sample HTML, Javascript, PHP and other code presented above in your own projects. You may not reproduce large portions of the text of the article without our express permission.

Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!