If this is an old IE browser (perhaps 3...), the bgsound tag will try to function. If this is a current IE browser (version 5...) or a Netscape browser that isn't brain dead version 6 - sorry, I don't how else to characterize that particular browser - the embed tag will try to function. The bgsound tag hides the audio controls by default. The embed tag is more flexible and therefore has to be told to start by itself and to hide the controls. Because some browsers understand both embed/noembed and bgsound, the bgsound tag has been nested inside a noembed tag to avoid redundancy.
<cfif isDefined("Soundsrc")>
<cfif fileExists(expandPath(#Soundsrc#))>
<cfoutput>
<embed src="#Soundsrc#" autostart="true" hidden="true">
<noembed>
<bgsound src="#Soundsrc#">
</noembed>
</embed>
</cfoutput>
</cfif>
</cfif>
<cfif isDefined("url.src")>
<cfset Soundsrc=url.src>
<cfinclude template="sound.cfm">
</cfif>
Listen to these...
<a href="soundtest.cfm?src=kapow.wav">WAR</a>
<a href="soundtest.cfm?src=moo.wav">FARM</a>
<a href="soundtest.cfm?src=phone.wav">PHONE</a>
<a href="soundtest.cfm?src=music.mid">MUSIC</a>
I had the best success initially with .wav files. You may have to adjust Netscape's list of applications that it uses for various file types. If multiple plugins support the media type you want to use - you'll probably find that Microsoft applications are listed for MIDI files multiple times - you may have to remove some of those references until you get something that works. Netscape's flexibility works against you when trying to pick media formats that multiple copies of the same Netscape version can hear without having to make individual adjustments of this nature. On one computer I tested with, I wound up removing and reinstalling my Netscape browser and manually changing the settings in Windows Player to get the Netscape browser to play sounds. As I wrestled, solutions that let me play .wav files wouldn't support .midi and solutions that let me play .midi files wouldn't let me play .wav files. I know it's possible to get both at once, but it isn't easy.
Because it is quite likely that the user's computer is not configured properly - one of mine still isn't - I don't recommend this approach for sound to be heard by users. Users typically spend their time configuring their boxes to play streaming audio, not short alert noises. The situation with short sounds is similar to the situation with the mailto tag; you don't use them if you have an alternative.
So given that cross-browser sound takes manual adjustment, what will you do with short sounds? I find them most useful on the administrative side. If you have a window open that refreshes itself periodically to monitor a process, you can let it give you an audible alert when something goes wrong. Use short sounds, and tell us what they do for you. If you find a better way to provide sound to Netscape users, we need to know that, too.
By the way, if one of the sounds you're trying out runs longer than you'd like, you don't have to close browsers to get rid of it. Just click on a different sound; it will replace the current sound immediately. =Marty=