Solved

script for playing music

Posted on 1998-08-27
190 Views
Hi,

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.
0
Question by:nopro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 3
• 2

LVL 6

Accepted Solution

thresher_shark earned 200 total points
ID: 1854595
0

LVL 6

Expert Comment

ID: 1854596
Here is the script you requested.  Just copy and paste into your web
page.

<SCRIPT>
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))
midi=(“4seasons.mid”)
if (x == (2))
midi=(“barberofseville.mid”)
if (x == (3))
midi=(“beeth5thsymp.mid”)
if (x == (4))
midi=(“fotbb.mid”)
if (x == (5))
midi=(“ithotmk.mid”)
if (x == (6))
midi=(“mars.mid”)
if (x == (7))
midi=(“moonlightsonata.mid”)
if (x == (8))
midi=(“puttinontheritz.mid”)
if (x == (9))
midi=(“thesting.mid”)
if (x == (10))
midi=(“rocky.mid”)

document.write(‘<p><EMBED SRC= ‘  + midi +  ‘ AUTOSTART=”TRUE”
HIDDEN=”TRUE”></p>’)
</script>

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:
http://www.geocities.com/SiliconValley/Pines/4004
and make sure your speakers are on.  Hopefully you like more-or-less classical music :)

Have fun!

0

LVL 6

Expert Comment

ID: 1854597
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!
0

Author Comment

ID: 1854598
Thanks, the script does exactly what I want it too!  I like this Experts-Exchange!
0

Author Comment

ID: 1854599
Thanks, the script does exactly what I want it too!  I like this Experts-Exchange!
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month5 days, 19 hours left to enroll