Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

script for playing music

Posted on 1998-08-27
5
Medium Priority
?
201 Views
Last Modified: 2013-12-25
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
Comment
Question by:nopro
  • 3
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
thresher_shark earned 800 total points
ID: 1854595
Answer coming...
0
 
LVL 6

Expert Comment

by:thresher_shark
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!

If you have any questions, please ask!
0
 
LVL 6

Expert Comment

by:thresher_shark
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

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

Author Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question