script for playing music


i have seen web sites that randomly play a sound file stored on the server.  Can anyone provide me with a script or something that would let me do that!  Thanks.

Please explain how the script works as well.  I am curious.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Answer coming...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Here is the script you requested.  Just copy and paste into your web

nummidi = 10
day = new Date()
z = day.getTime()
y = (z-(parseInt(z/1000,10)*1000))/10
x = parseInt(y/100*nummidi,10)+1
if (x == (1))
if (x == (2))
if (x == (3))
if (x == (4))
if (x == (5))
if (x == (6))
if (x == (7))
if (x == (8))
if (x == (9))
if (x == (10))

document.write(‘<p><EMBED SRC= ‘  + midi +  ‘ AUTOSTART=”TRUE”

To use it, simply replace the names of the midi files with the ones you want.  Make sure the numidi = 10 line equals the number of midis you have below it.  Those are the only things you need to know to use it.

If you want to see its implementation, visit:
and make sure your speakers are on.  Hopefully you like more-or-less classical music :)

Have fun!

If you have any questions, please ask!
To be honest, I'm not entirely sure how it works, I got it from a friend of mine who works on web pages a lot.  I just did what he told me to do and it worked!
noproAuthor Commented:
Thanks, the script does exactly what I want it too!  I like this Experts-Exchange!
noproAuthor Commented:
Thanks, the script does exactly what I want it too!  I like this Experts-Exchange!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.