Links << Music & Sound
Music or Sound files can be found on the internet. Some people have a program which allows them to record from CD-ROMs or use a microphone. Saving a music file off the internet is done the same way as saving an image file.

1. Right click on the link to the music file.
2. Choose 'Save Link As' (or 'Save Target as').

Be sure to remember where you save the file and the name of it. You can then upload the file to your online server and create a link to it. The name of sound files are CaSe SeNsItIvE. Music.mid is different than music.mid.

Note : DO NOT STEAL BANDWIDTH. That means, do not link your page to retrieve and play a sound stored on another person's site.

Most sound or music files have a WAV or MID or MP3 extension. A MIDI file (a file that ends in .mid) is a small file of instructions that tell the sound card HOW to play a song. The better the sound card, the better it will sound. All of the actual playing is done on the visitor's computer. You cannot "record" existing sounds as MIDI. A WAV file (a file that ends in .wav) is a digital recording of a sound. It is much like a cassettte tape or CD ROM. Because there is so much information contained in a WAV file, these files tend to be VERY large. Mp3 are a newer version of sound files. They contain a much higher quality of sound.

There are 2 main ways to link to sound files.
  1. Foreground (regular link). The visitor clicks on an area to activate it.
  2. Embedded. Used for background music or automatic playing.

Foreground (regular link)

Foreground music allows the visitor to click on a text or image link to activate their browser music player. This is the most perferred to both visitors and web page designers. The visitors have a choice to activate the music (or not) and the designer (you) will have a faster loading page since the music file is note taking time to download.

<a href="FileName.mid"> Click here for music </a>

This will create a text link calling up the visitor's music player and load the file FileName.mid. Another advantage to FOREGROUND linking is the visitor's control over the playing and volume of the sound. Many visitors hate being FORCED to listen to some music they did not choose and have no control over.

Embedded (background)

Embedded sounds are commonly referred to as BACKGROUND music. It does not require the visitor to click on a link to activate it. The web page can either show a "console" window or have the music completely in the background. This form is very similar to the concept of placing an image onto the page. The sound file will be displayed on the page.

<embed src="FileName.mid">

That will cover most web browsers these days. There were a few extra code lines for much older browser versions, but those days are gone.

Similar to an image tag, the SRC shows the SourRCe of the sound file to use. Other properties to set and control the sound file are :


WIDTH and HEIGHT (in pixels) control how long and tall the console will be. This is very similar to assigning image properties. When a music file plays, the browser player will start and a control box appears. It's good to keep these around WIDTH=150 and HEIGHT=55. This will leave enough room for different player plug-ins to fit into the assigned area.

<embed src="FileName.mid" width="150" height="55">

This will give the visitor a control box this size :

To eliminate the control box from the web page, set the WIDTH and HEIGHT to zero. The music will still play, but the visitor will have no control over it. Thus creating a totally background playing sound.

AUTOSTART controls the music starting to play. Setting this to TRUE, the music will start to play automatically after loading. Setting this to FALSE, the music will load and wait for the visitor to click on the play button in the console box.

<embed src="FileName.mid" width="150" height="55" autostart="true">

CONSOLE creates a display format to control the playing sound. The values for this property are :


Some people leave this property out and let the browser determine a default display. Other people like to limit the controls the visitor has on the playing sound. Test out different CONSOLE values and change the WIDTH and HEIGHT settings to create the best display for your needs.

<embed src="FileName.mid" width="150" height="55" autostart="true" console="smallconsole">

LOOP controls how many times the song is going to be played. This property should be set for both browsers.

<embed src="FileName.mid" width="150" height="55" autostart="true" console="smallconsole" loop="true">

The TRUE and INFINITE settings will make the sound (music) play continuously, over and over again, non-stop. The other allowable values are FALSE or a number. Using a number will play the sound file that many times before quitting.
Links << Music & Sound

Advertise in the banner along the top, Click here!

Valid XHTML 1.0 Transitional Valid CSS! Text Link Ads