Solved

script for playing music

Posted on 1998-08-27
5
179 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 200 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now