Click the logo to add
this site to your Favourites


This Site The Web

Quick Links


Subscribe to my Newsletter

Books presented in association with:


Your Free E-Mail


Send me mail!

Send Me Mail



Embedding Sounds



How we embed sound
The Script
Program Specific Instructions
Further info

:  the information below applies only to Outlook Express 4 and Outlook 98.  With Outlook Express 5 the method of including sound has changed - please see the OE5 sound page for information on this subject.  Sounds embedded in OE4 can still be heard in OE5, they just can't be embedded in the same manner.



After graphics and text, the next logical thing to include in stationery is sound.   Unfortunately Microsoft does not seem to have foreseen this want as there is no native way to embed sound into Outlook Express.  That does not mean it cannot be done however, as several methods exist.

In a regular HTML document (one intended to become a web page) setting a background sound is easy:

<bgsound src="path/music.file" loop="1">

And technically this method will work with Outlook Express.  However, to do this in OE, the path must include the entire url of a website where the actual sound file is located.  If you reference a sound file on your hard drive, it does not embed into the message, thus no-one but you will be able to hear it. Instead, if the sound is located on a web server somewhere, then all will be able to hear the sound - this is known as sound linking.  The problem with this method is that only people who are online when they read your message will hear the sound and since OE has to connect to the website and download the sound anyway, no time or size is saved.  You are best to embed the sound so that all of your potential audience can hear it.

How we embed sound:

Sound is embedded into an Outlook Express message by scripting, either JavaScript or VBScript.  Both work and both function roughly the same way.  In fact - the script I display below functions identically in both languages so the scripting language is not even set.

The first thing that happens is we need to trick OE into actually embedding the sound.  We do this by loading a sound but telling OE that it is actually a graphic.  Don't worry, it isn't as complicated as it sounds.

<img id="music" src="path\music.file" height="1" width="1">

This starts off with what looks to be a regular <img> tag for a graphic except that the src points to a sound file (.wav and .mid being the most common).  Note the height="1" and width="1" section.  Since the sound file is not actually a graphic when OE attempts to display it as a graphic it would result in the dreaded X which indicates that there is something wrong with the file.  By setting the height and width to 1 pixel we make that red X smaller than the eye can see so it doesn't detract from the stationery.

That leads to another problem - accidentally deleting the sound in a compose window because you can't see where it is.  If you find you encounter that problem often then set the height and width to about 10 or 12 pixels, and include the following in the <img> tag:  style="Display: none".  The finished thing would look like this:

<img id="music" src="path\music.file" height="10" width="10" style="Display: none">

That sets the height and width of the box to 10 by 10 pixels so you can see it while in a compose window and stops it from displaying at all when viewing the message so that you don't have a small extraneous box which detracts from your message.

Now pay attention to the id attribute of the <img> tag.   This is very important.  It names the sound loaded so that the script can find it to work with it. 


The Script:

!--webbot bot="HTMLMarkup" startspan -->

<img id="music" src="You Sound File Here" height="10" width="10" style="Display: none">
bgsound id="sound" src>

<!--webbot bot="HTMLMarkup" endspan -->

As you can see this is a rather simple script. There are many variants of the sound script that people use, indeed, if you've been paying attention over the last 2 years, you'll know that I've gone through about 6 different versions on this page alone.  I have finally settled on this version for a couple of reasons.   This is the script that I used in my various toolbars and I felt it was best to standardize on one variant.  More importantly, this is the simplest sound embed script that I've seen and it eliminates nearly all of the places where people would have problems with the other variants.

If you want to know the mechanics of how the script actually works then I suggest you purchase a beginners book on the scripting language you're interested in, that is a little beyond the scope of what I intend to do here. 

The script shown above is the basic sound script - it'll embed sound in OE4 and Outlook 98 & 2000 and play it upon the message being opened by your recipient.  Due to overwhelming requests I also have a "deluxe" sound script for use in OE4 which includes a built-in volume control.  This allows your recipient the opportunity to control the volume at which the sound is played back without forcing them to leave OE to look for a volume control or to adjust the master volume on their speakers, a couple of clicks is all it takes.

To see an example of the "deluxe" script in action, click the Example button below:


Program Specific Instructions:


Further Info:

Although I have only spoken about midi (.mid) files in this example, this embedding method works equally well for wave (.wav) files, merely point the src at a wav instead of a mid if you wish.


Home | FAQ | Download | TroubleShooter | Discussion | PSP | MIC | WET Retrospect | Feedback


1998, 1999 sven All content designed and written by sven, except where noted.

Disclaimer:  I am not affiliated in any way, shape or form with Microsoft Corporation.  All opinions expressed on this web site are mine alone and may not represent those of the majority of Outlook Express users.  All brand and product names are trademarks or registered trademarks of their respective owners.  No animals were harmed in the creation of this website.  All characters and situations portrayed on this website are completely fictional.  Any resemblance to actual persons or events is purely coincidental.  Your mileage may vary.  Past performance is not a reliable indicator of future gain. No purchase necessary.