Back How To: Add Sound to Your Web Page

 

Inserting Sound with Dreamweaver

Link to sound

Simply selecting a piece of text and creating a link in the Properties Inspector.
Users will normally get a download dialog box

Link to music.mid

Behaviors

To attach a sound to the page or an object on it you can use a Behavior. From the Behavior pallet select play sound and browse for the file to play. The start action can then be modified from the drop down list. Note the numer of option will depend on the target browser selected. The example on the right has a Sound file with Behavior attached to the picture of the girl. It should play a sound on passing the mouse over the picture? The example below uses an "onclick".

Code for the first example right:
This first line is with the code for the picture...
< img src="girlstamping.GIF" width="122" height="182" onMouseOver="MM_controlSound('play','document.CS1057453403349','TAPDNC0A.WAV')">

The second block is a JarvaScript hidden in the head statement, see below...

Behaviors Example

A tapping noise?

Dreamweavers Code

The program creates all the required code for you!

To view the code for this page right click and selet view source.

Or from the main tool bar select view > view source.

<script language="JavaScript" type="text/JavaScript">
 < !--
 function MM_controlSound(x, _sndObj, sndFile) { //v3.0
 var i, method = "", sndObj = eval(_sndObj);
 if (sndObj != null) {
 if (navigator.appName == 'Netscape') method = "play";
 else {
 if (window.MM_WMP == null) {
 window.MM_WMP = false;
 for(i in sndObj) if (i == "ActiveMovie") {
 window.MM_WMP = true; break;
 } }
 if (window.MM_WMP) method = "play";
 else if (sndObj.FileName) method = "run";
 } }
 if (method) eval(_sndObj+"."+method+"()");
 else window.location = sndFile;
 }
 //-->
 < /script>

Pop the Baloon!

pop it!

On Click Sound

Embedded or Linked Sounds
Versus the Plugin?

The first two methods are relatively straight forward. The third option is to use a plugin, although simplified with the use of Dreamweaver the author has a wider range of choices. The process has been further complicated by an incompatibility between Quicktime™ and Internet Explorer V 5.5/6 The problem only effect Widows users with these two versions but that is the vast majority in educational establisments! More information on the subject in the section How To Hand Code Sound into Your Page

Please download my notes for using plugins in Adobe PDF format. (Printer friendly)

 
Copyright Complete Image

 

 
©Complete Image06/07/2003