Sound can be added to web pages in two basic formats:
Sound files come in a variety of formats:
The size of a wave file depends on the duration of the sound, the number of bits (8 or 16) used to encode the data, the sampling rate in Hz, and whether the sound is monophonic or stereophonic. CD-quality stereo, sampled at 16 bits and 44,100 Hz, takes megabytes for just a minute or two. Recording in mono cuts the size in half, as does 8-bit encoding or 22,050 Hz sampling; all three would make a file one-eighth the size. Sampling at 11,025 Hz cuts it in half again; voice sounds good at that sampling rate, and music sounds "acceptable".
Most of these options are not available with the primitive sound tools that come with Windows or Mac, but most PC sound cards come with a sound editor, and free- and shareware programs are available for Mac (see Dave Grasmick's Almost Everything You’ve Always Wanted to Know about Sound) and Windows (a few select programs at Tucows, even more at Winsite, and GoldWave, the program I use) that do even more.
The sound of a midi file is produced by the sound synthesizer in your computer; even a well-made midi can sound terrible on a bad sound card. More important, even good sound cards can sound different, so that midi is not suitable if you want your audience to hear subtle differences in timbre.
Midi also cannot reproduce sounds that are not built into the synthesizer, such as spoken or sung words, unusual musical instruments, and most non-instrumental sounds. There is a file format called ".mod" that combines sounds and midi instructions; we won't consider it further here.
Here is an example of a midi file, Io non compro più speranza, by the Italian Renaissance composer Marco Cara. It is a simple hyperlink, but to a midi file rather than a web page. If you click it, and your browser and computer are capable of playing midi files, you should hear it.
Space for this page is provided by California State Polytechnic University, Pomona. Although it is intended to further the educational mission of the University, the opinions expressed here are those of Curtis Clark, and do not represent official policy of the University.