Dreamweaver - Adding sounds

Background music, played while the user is viewing your site can be extremely effective and adds to the "multi-media" experience.

Very simply achieved, it involves adding a few parameters to the <embed> tag: hidden tells the browser not to display any controls; autostart tells it to start playback automatically on page load and loop tells it to play the audio continuously.

There are around ten file formats for audio, some of which such as .au, .aif and .wav have all rather been left behind in terms of compression, file size and quality. At the time of writing, we would recommend the .mp3 format.


The best way of getting a sound file into your web structure is simply to drag and drop it into the root folder of your site. The next step is to embed the sound file into the web page you require sound for. The easiest method is via the Property Inspector.

Position the cursor near the top of the web page and go to Insert...Media...Plugin.

Dreamweaver inserts a 32 x 32px placeholder to indicate where the Plugin code is located. You can resize this placeholder so your layout won't be affected.

In the Property Inspector, enter 2 in both the H (Height) and W (Width) boxes. (This is necessary for compatibility with older browsers)

With the plugin icon selected, In your Property Inspector click the 'Parameter' button.

In the Parameters dialog box, click on the + button and type autostart in the Parameter column. Hit the Tab key twice to move over to the Value column and type in true. Press the + button again and type in hidden, again using the Tab key to go over to the Value column and type in true. Finally use the + button again to move down a line, type in loop with true in the Value column.

What this is doing is basically, by giving autoplay a true value (as opposed to false) it determines whether the sound begins
playing when the page is downloaded. Similarly, if you'd have entered a number in the Value of Loop instead of true, this would be the number of times the tune repeated itself.

Finally in the Property Inspector, in the Src window, click the "browse" icon to find the audio track you require.

Save your page and preview it in a browser - with the speakers turned on!

©grafikhaus 2015 | sheffield-central.com