ThePlace

Home ] Search ] Resources ] Site Map ] Contact Me ]
Dave's Information Technology Resource

Up ] Using Digital Audio on the Web ]

Multimedia References ] Text ] Graphics ] [ Digital Audio ] MIDI Files ] Digital Video ] Streaming Content ] Flash Animation ]

--- Digital Audio ---

Ways to Play Audio on Web Pages

bulletHi There! Audio Clip (click to download, also played on page load) -- uses an anchor tag (hyperlink), file is downloaded and plays
bulletEmbedded Wave via the embed tag
bullet"<bgsound src="hithere.wav" loop="1">" - bgsound tag, plays on startup
bulletClient 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:

bulletWave (.wav) - used in PC/Windows
bulletAIFF - common Macintosh format
bulletAU (.au) - UNIX format
bulletMP3 (.mp3)- MPEG compressed format
bulletReal Audio - streaming format (plays while loading)
 

Characteristics of Digital Audio...

Sound is the propagation of air waves!

General characteristics of sound are...

bulletLoudness...or volume is the strength/weakness of a sound.
bulletPitch...how high or low a sound as perceived by the ear; a function of the frequency.
bulletTimbre..."color" or tone of the sound, e.g., the difference between a piano and a harpsichord playing the same note.
bulletAcoustics...impact of sound bouncing off or being absorbed by objects.
bulletReverberation and delay...effect of sound coming back (an echo).

 

The basic features of digital audio are...

  1. 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
  2. Channels - mono and stereo
  3. Capture Depth - 8,16, and more bits (24 to 40+) - more bits is better!

Digital audio entails...

bulletCapturing sound levels (capture depth) at a frequency using one or more channels.
bulletVarious encoding schemes (pulse code, adaptive, etc.) are used to format the data capture.
bulletCompression 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).

 

 

 

 

Home ] Up ] Computer Architecture ] Programming Bootcamp ] Database Bootcamp ] Visual BasicS ] Web Basics ] Web Programming ] Advanced Web Topics ] Developing Web Sites ] XML Technology ] Web Glossary ]

Copyright © 1999 - 2005 
ThePlace - Written and Sponsored by Dave Hillman