Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timed sound delay...

Status
Not open for further replies.

codeone

Programmer
Mar 25, 2003
343
US
Hello,
I was wondering if someone could show me how to setup a Jscript which will delay a sound embeded in my web page. What I want to do is to have the page start and like 1 minute later a sound to play. I would appreciate any and all help from the forum.

Thanks

Code One
 
<body onload=&quot;wait1minute()&quot;>

<script>
function wait1minute()
{
//wait 1 minute = 60000
window.setTimeout(&quot;Play Sound&quot;, 60000);
}
</script>
 
Re: EMBED, OBJECT or BGSOUND

Can the browser know when file has finished playing? I was looking for a way to make the browser play a number of music files one after the other without user input.
 
Hey guys Im a total dufus this past week, I think I am losing my head, and I can not do anything right it seems. So can someone please hold my hand on this one and show me how to setup this script. So far &quot;anyideas&quot; helped me out by scrapping me up this script:
==========================================================
Code:
<html>
<head>
<script>
function wait1minute()
{
    //wait 1 minute = 60000
    window.setTimeout(&quot;Play Sound&quot;, 60000);
}
</script> 
</head>
<body onload=&quot;wait1minute()&quot;>
<embed src=&quot;mySong.wav&quot; ?????????>
</body>
</html>
==========================================================
Now to you this is simple to me it is like duhhhhhhh. So please just show me how I would make the above script delay the embed src for the alloted time as is above as well.

Sorry to be so slow, ;)

Code One


 
please review the above post and please allot me an answer if possible from anyone here. I am going mad trying to make this script work right and I am out of solutions, please if anyone can figure this out and post it for me that would be great.

Thanks guys,

Code One
 
The problem might be the browswer you are using is not IE. window.setTimeout was not a standard last i checked and was only a microsoft thing.

i am not sure that this script would work as written anyway, but thought the info about the browsers might be helpful.
 
Okay.

First of all, &quot;Play Sound&quot; was supposed to be a JavaScript command (as far as I can tell). Whatever command you would use to play a sound, insert it there.

Second, setTimeout isn't Microsoft-only.

Third, if you want to play a series of pieces of music, my first thought would be to simply put all of the pieces in a single sequential file, and then loop it.

Fourth, this conversation might help: thread216-34300

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top