Make your own free website on Tripod.com
Using Sound /LiveAudio
What's all this noise about anyways..huh!!

A few basics first, to insert sound in ur html page what u need to do is use the <embed> tag. Click the first link below to play the first sound. There's nothing much but just a hello from me.

Play the 1st sound now!

Now try the second link.

Play the 2nd sound now!

Ok now for some explanations:

<EMBED SRC="sound1.wav" HIDDEN=TRUE AUTOSTART=FALSE NAME="firstsound" MASTERSOUND>

What u see above is the code I have used to insert the sound into ur html page.
Well the SRC attribute is used to specify the sound file to play. The HIDDEN=TRUE is used to hide the control, otherwise u would see a set of buttons for playing the sound...increasing the volume...stopping the sound etc. But what we're doing out here is trying to control all these elements through code. The AUTOSTART=FALSE is used to specify that the sound shouldn't start playing on it's own. The Name attribute is used to specify the name by which u can refer to this particular embeded object. Well then what's the MASTERSOUND for...aaha...well...ok...This is because anytime a NAME attribute is used referencing LiveAudio, an accommodating MASTERSOUND tag must be present as well. Well instead of putting down the entire Netscape documentation on LiveAudio...i've provided 2 links which u could use as a refrence and a link to sample scripts. Check these out later for a through coverage of Liveaudio.

Using OnMouseOver


Move the mouse here to play 1st sound

Move the mouse here to play 2nd sound


Well well what we r doing out here is that we r using the onMouseOver function to play the sound...the code is pretty simple.
<A HREF="javascript:dummy()" onMouseOver="playsound1();return true;">
and the playsound function is ....
 function playsound1()
                {
                document.firstsound.play(false);
                }

all it does is calls the play() function which plays the sound associated with the "firstsound" object.
COOL RIGHT !!! :-)
That's all for now I'll add more stuff on this later and if u send me a mail specifying what more u want covered out here.

- Controlling SOUND/LIVEAUDIO as of 20 th Jan 1997.


HOME



This page is maintained by Sanjay Shetty.
Send mail to sanjay@dbsindia.com.

U R visitor no .