Web Audio


On November 14th, I spoke at Vocaltech 98 about getting music on the web. Below are my notes from that presentation in html form (including an online audio format quality comparison). You can also download the notes in Microsoft Word for Macintosh format here.

-Christopher Schardt


digital audio concepts

bitrate

The number of bits transmitted per second.

Transmitting audio data on the web is not trivial. For every second of CD-quality audio, the server, the internet, and the browser must handle:

44,100 samples/sec
x 2 bytes/sample
x 2 channels (for stereo)
= 176,400 bytes/sec
= 1,411,200 bits/sec , the bitrate
This is approximately 25 times more data than can be received real-time by your typical 56K modem. (A 56K modem can transmit up to 56,000 bits/sec.)

downsampling

In order to get the bitrate of audio data down to workable levels, some web authors will lower the sample rate and/or convert stereo data to mono. This obviously affects sound quality.

compression

In order to be transmitted efficiently, nearly all audio on the web is compressed in what's called a "lossy" audio format. This means that when the audio is eventually un-compressed in the browser, something is lost. It could be a little less clear, it could be missing the higher frequencies, or there could be more static.

Often compression is used in conjunction with some kind of downsampling.

Common types:

streaming audio

Streaming audio formats allow you to hear the audio as it downloads. (You may have to wait a few seconds for it to start.)

If for some reason the data flow is interrupted or slowed down too much, the audio playback will hiccup and/or stop. (RealAudio and LiquidAudio have special server software to try to keep this from happening.)

The audio has to very compressed to work with modem connections. This means a bitrate of 16Kbits/sec for 28K modems, 32Kbits/sec for 56K modems. The audio quality is therefore rather compromised. It often sounds like a weird flanging effect (especially RealAudio).

non-streaming audio

This is the classic way of delivering audio on the web. You click on an audio link, then wait for the audio data to finish downloading until you can hear any of it.

The audio quality can vary from perfect (uncompressed) to horrible (downsampled, extremely compressed). It's up to the web author to decide the tradeoff between better sound quality and quicker download time.

performance data

Data that expresses the performance of a piece of music, rather than its actual sound.

Inherently very compact since audio data requires 1000s of bytes per second and a single note requires maybe 6 bytes.

Most common form is MIDI.


making music digital

Before we can think about putting your music up on the web, we have to first get it into your computer as files on your hard disk.

from a CD

By far, the easiest way to get a song into a computer is to transfer its data directly off the disc. You'll need a program known as a CD-ripper.

A long list of CD-rippers can be found at MP3.COM

If you have a program called Toast on your Macintosh, it probably came with a program called Toast Audio Extractor. This is a very good CD ripper program.

from an audio source

This can get much more involved:

It's beyond the scope of this discussion to get further into this.


audio format summary

streaming formats

Shockwave audio (my favorite)

RealAudio

LiquidAudio

non-streaming formats

MPEG audio

AIFF/AU/WAV

audio/performance data formats

MIDI

RMF

MOD


audio format quality comparison

using Nature Wins Again from Moe's Kitchen's new CD, Grooveprint

Shockwave 16Kbits/sec
Shockwave 24Kbits/sec
Shockwave 32Kbits/sec
RealAudio 16K/sec mediumband
RealAudio 16K/sec fullband
RealAudio 32K/sec mono
RealAudio 32K/sec stereo
MPEG 128K/sec stereo