XHTML: Sound

From Academic Computing

Jump to: navigation, search

Contents

[edit] Purpose

This workshop introduces students to the steps involved for adding sound to a web page.

[edit] Prerequisites

Students wishing to participate in this workshop must be familiar with basic hypertext markup (HTML or XHTML). Students wishing to save any work created in class should bring a formatted floppy disk.

[edit] Sound on the Web

There are types of audio files used on the Internet: Static and streaming audio.

Static audio comes in hundreds of file formats. The most popular on the World Wide Web are WAV, MIDI, and MOD. These formats are popular because for most formats, you do not have to download a “plug-in” program to listen to them. Depending on the size of the sound file, you might have to wait a very long time for the sound to play. For example, one minute of CD-quality, stereo sound will take over 10 minuets to download using a 56K modem.

To eliminate these long waits, streaming audio was invented. The most popular form of streaming audio is called Real Audio. You can listen to live broadcasts from all over the world. There are two major problems with streaming audio. First, in order to listen to streaming audio, you must download a “plug-in” for the browser you are using. The second problem is the cost to make the audio files. Those files require special web servers to broadcast from (which USF does not have), so we will not be covering streaming audio in this class. However, if you would like to know more about the Real Audio format and listen to some broadcasts, please go to http://www.realaudio.com.

[edit] Static Audio Formats

[edit] MIDI

MIDI stands for Musical Instrument Digital Interface. It is actually a language that your sound card understands. MIDIs have extremely small file sizes because hey are simply text files which tell your sound card what note to play on what instrument and for how long. Media Player is one of the players that will play MIDI files as well as several other types of audio files.

[edit] MOD

MOD files are like MIDIs in that they contain a text file that tells your sound card what sound to play and when, but instead of using computer-generated tones, it uses “samples” of recorded real-world sounds. This is not as frequently seem (heard) on the web. The size of the MOD is determined by the size of the samples. It is possible to have a MOD that is several minutes long using just a few samples, keeping the file size under 100KB. Conversely, if a lot of samples are used, a short MOD file could be several megabytes. To listen to a MOD file, you mush download a MOD player off the web.

[edit] WAV

WAV files are the “native” sound format used in Windows. They consist of digital audio which mush be recorded from either a live source or a CD. The size of the WAV files vary greatly depending on their quality. CD quality, stereo sound is around 10MB per minute, while a minute of FM quality, mono sound is about 1 MB. Media player comes with Windows will play WAV files. In addition, sound recorder will allow you to record audio form a CD or live source.

[edit] Including sound on the web page

There are two ways to include sound in your web page, simple link that links to the file, and the embedding background sound.

By using the <a href> tag, you can create a link to the sound file you wish them you download.

<a href=”sound.wav”> Click to download the sound. </a>

When you click on the link, the sound file will be downloaded and played.

The embedding tag embeds a small radio like icon onto your web page. It contains controls to play, pause and rewind the sound as well as a volume slider.

<embed src=”sound.wav” height=”35” width=”16” 
 controller=”console” autostart=”false” volume=”50” 
 loop=”20” >

src="file name" Look for the file name.

height="pixels" width=”pixels” Controls the height and width of your controller.

controller="true/false” Controls the availability of the controller taskbar while a movie or sound is playing.

autostart=" true/false” Controls if the music starts play when you load the page or not.

volume="#” Controls the volume of the sound.

loop="#” Controls the number of loops the sound would have (play again after end).

Personal tools