Background Music can be added to any Web Page using the Page Music Dialog from the Page Menu or toolbar. The Dialog only has three options. These are the path to the file and check boxes to enable the music and select continuous or single play. Be sure to check the Enable Music boxes since this will not be enabled automatically.
The "Select Now" button will allow you to browse to find an audio file. The default format will load a midi file. This is the most compact option for playing music and will add the smallest download penalty.
In IMS Web Engine you can also add audio through the Sound Effects dialog. This essentially works the same way as the Page Music dialog but it can also be controlled by a Behavior. Like the Page Music dialog, you can browse to an audio file but in this instance it will default to load a Wave File.
The primary disadvantage with Sound Effects is that they are not supported by Netscape. This is due to Netscape's use of the EMBED tag which launches an external plug-in to play the sound effect. In Internet Explorer, a sound effect is attached to an Object in the same manner as Shading, Actions and Behaviors. By adding both a Sound Effect and a Behavior to an Object, it is possible to control the sound effect. The Behavior Action Dialog includes a Sound Check Box so that you can turn the sound effect On and Off as the Behavior switches between Active and Inactive.
I have posted an example:
You can use any audio file that is supported by your system. Generally MIDI, WAVE and MP3 are the most common. If you want to mix both a Sound Effect and Background Music as in the example, you will have to use two different formats.
As you will note, neither the Page Music dialog nor the Sound Effect dialog includes a volume control. This is because there is no way to adjust the playback volume from within the HTML document. You will have to rely on the listeners to adjust the volume themselves.
A fairly complex example of controlling sound effects can be viewed at: http://www.virtualmechanics.com/demos/P&GWake.htm Unfortunately it will only work in Internet Explorer.
"IMS Web Tips" is a weekly news letter for all web site managers regardless of experience who are looking for detailed information on creating, maintaining and promoting their web sites.
To subscribe send anemail to firstname.lastname@example.org or visit www.IMSWebTips.com for subscription information and a list of past articles.
If you like the contents of this newsletter, please recommend it to a friend. Not only will you help us to continue to provide you with useful and informative articles, you could also win $10,000. Click here for details.