Start and stop of sound

  • Thread starter Thread starter Harish
  • Start date Start date
H

Harish

How to introduce 2 buttons,One is for stopping and another for starting
a sound in a web page by the method embed.Can you show with full code.
 
This works for me. You will have to import your sound file into the FP
folder list.
<object id="MediaPlayer" width=68 height=66
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
standby="Loading Microsoft® Windows® Media Player components..."
type="application/x-oleobject
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<PARAM NAME="filename" VALUE="yoursong.mp3">
<PARAM NAME="autoStart" VALUE="true"> <PARAM NAME="showControls" VALUE="true">
<param name="ShowStatusBar" value="true"> <PARAM NAME="Autorewind"
VALUE="true">
<PARAM NAME="ShowDisplay" VALUE="false">
<EMBED SRC=src="yoursong.mp3" WIDTH=70 HEIGHT=70
type="application/x-mplayer2" name=MediaPlayer autostart=1 showcontrols=0
showstatusbar=1 autorewind=1 showdisplay=0>
</EMBED></OBJECT>
 
but where is the code ok any way i have done like this but the sound is
not coming can u check this and send me a updated source code.I want it
with 2 different buttons

<html>
<body>
<head>

<embed id="theNoise" name='theNoise' src="C:\Documents and
Settings\jharish\Desktop\Share\test\sounds\attention.wav" width="20%"
height="20%" hidden="true" autostart="false" loop="3" >
</embed>

<script>

function makeNoise()
{
document.theNoise.start();
return true;
}

function killNoise()
{
document.theNoise.stop();
return true;
}

</script>

<INPUT TYPE="button" ONCLICK="javascript:makeNoise()" value="Start
Sound">
<INPUT TYPE="reset" ONCLICK="javascript:killNoise()" value="Stop
Sound">

</head>
</body>
</html>
 
The way I showed you is the method used by MS Front Page to embed the media
player. The code I posted can be placed anywhere within the body of the
html. It displays the player's minimum size that will allow inclusion of a
stop, start and pause button.

You are trying to use a script with input buttons and I can't help you with
that.
 
Back
Top