Ways to Play Audio on Web Pages
 | Hi There! Audio Clip (click to download, also played on page load)
-- uses an anchor tag (hyperlink), file is downloaded and plays |
 | |
 | "<bgsound src="hithere.wav" loop="1">"
- bgsound tag, plays on startup |
 | Client scripting - use the named embed object to play, pause,
rewind, etc. |
Common Audio File Formats
The following are generally the most common file formats use in web-based
applications:
 | Wave (.wav) - used in PC/Windows |
 | AIFF - common Macintosh format |
 | AU (.au) - UNIX format |
 | MP3 (.mp3)- MPEG compressed format |
 | Real Audio - streaming format (plays while loading) |
Characteristics of Digital Audio...
Sound is the propagation of air waves!
General characteristics of sound are...
 | Loudness...or volume is the strength/weakness of a sound. |
 | Pitch...how high or low a sound as perceived by the ear; a function
of the frequency. |
 | Timbre..."color" or tone of the sound, e.g., the
difference between a piano and a harpsichord playing the same note. |
 | Acoustics...impact of sound bouncing off or being absorbed by
objects. |
 | Reverberation and delay...effect of sound coming back (an echo). |
The basic features of digital audio are...
- Frequency - range from 5khz to 44 khz (typically, 5.5, 8, 11, 22,
44 and even higher) - the greater the
frequency, the higher the quality
- Channels - mono and stereo
- Capture Depth - 8,16, and more bits (24 to 40+) - more bits is better!

Digital audio entails...
 | Capturing sound levels (capture depth) at a frequency using
one or more channels. |
 | Various encoding schemes (pulse code, adaptive, etc.) are used to
format the data capture. |
 | Compression can be applied at the expense of quality. |
Standards used in industry...
CD-Audio is 44khz, stereo, 16 bits
Acceptable voice (telephone quality) - 11khz, mono, 8 bits
File size is generally determined by...
time * frequency * channels * depth = filesize
Example...1 minute of CD-Audio...
60 * 44000 * 2 * 2 = 10,560,000 bytes
Example...1 minute of voice quality...
60 * 11000 * 1 * 1 = 660,000 bytes
File Format Descriptions
There are a number of digital audio file formats for a range of
computer environments, systems, and technologies. The following are some
of the more popular versions. Wotsit.org
- Sound and Music Files
is an excellent resource for finding out more about various audio formats.
| File Format |
Description |
| AIFF - Audio Interchange File
Format (Audio IFF) |
From Apple Inc.
A standard for storing sampled sounds. The format is flexible, allowing
for the storage of monaural or multichannel sampled sounds at a variety of
sample rates and sample widths. Audio IFF conforms to the " EA
IFF 85" Standard for Interchange Format Files developed by Electronic
Arts.
Audio IFF is primarily an interchange format, although application
designers find it flexible enough to use as a data storage format as
well.
Used primarily on Apple platforms. |
| AU |
From Sun Microsystems
Audio data is encoded in three parts: a header, containing fields that describe the audio encoding format; a variable-length information field,
in which, for instance, ASCII annotation may be stored; and, the actual encoded audio.
Capable of 8 to 64 bit encoding, multiple channels, and variable
sampling rates. |
| MP3 |
MPEG Layer 3, MP3,takes advantage of the fact that our ears are not
nearly as good as we generally believe them to be, and thus omitting
frequencies that we wouldn't hear anyway.
The format is also useful for streaming by letting the sound be
represented in small, individually compressed blocks of audio data. Each
block had a header containing some information relevant to the decoding
process. As they ended up with a few bits to much, they used them for some
additional information such as a 'copyright' bit and a 'private' bit.
|
| RIFF and Wave Format |
from Microsoft Corp.
RIFF is a Windows file format for storing chunks of multi-media data,
associated descriptions, formats, playlists, etc.
A RIFF file has an 8-byte RIFF header, identifying the file, and
giving the residual length after the header (i.e. file_length - 8). The
riff_hdr is immediately followed by a 4-byte data type identifier. The
entire remainder of the RIFF file is "chunks". Each chunk has an
8-byte chunk header identifying the type of chunk, and giving the length
in bytes of the data following the chunk header.
WAVE File Format is a file format for storing digital audio
(waveform) data. It supports a variety of bit resolutions, sample
rates, and channels of audio.
A WAVE file is a collection of a number of different types of chunks.
There is a required Format ("fmt ") chunk which contains
important parameters describing the waveform, such as its sample rate.
The Data chunk, which contains the actual waveform data, is also required.
All other chunks are optional. Among the other optional chunks are ones
which define cue points, list instrument parameters, store
application-specific information, etc.
The simplest waveform audio files consists of a header followed by
Pulse Coded Modulation (PCM) sound data, usually uncompressed 8 or 16 bit
sound samples. WAVE also provides a mechanism for audio codecs
(compressor/decompressor).
|
|