BY:Nick Heinle...Homepage
DATE:1996-06-28
Tip of the Week for April 29 1996: Playing Sound in an HTML Document
Alleluia! There are a at least three basic ways to play a sound or any kind of file for that matter right in an HTML document no plug-ins required. These examples use a sound file called "sound.au" which if you have a JavaScript compatible browser is probably downloading right before your eyes as you read. Well anyway here is the immediate method this is enacted as soon as the browser loads the page:
window.location = "sound.au"and here is the delayed method the number you see is the time it waits before loading the sound file about 10 seconds:
setTimeout("location = sound.au'" 10000)My personal favorite is the "when document is done loading" method. First after the <HEAD> tag put a <SCRIPT> tag and then:
function PlaySound(){ window.location = "sound.au" }Then in the BODY tag put the lineonLoad = "PlaySound()"I hope you find this useful because it can be used for a variety of applications yet it is soooo simple. The timer one is also great for automatically turning pages but make sure you give people enough time to download all of document and then read it before turning the page.
URL: http://www.oocities.org/SiliconValley/7116/jv_snd.html