Solved

script for playing music

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
API Soap Calls 4 86
Red number appears in lower right corner of browser with warning 8 68
Web Reply Form - PHP with Upload 4 53
Form Processing in PHP 11 30
Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

932 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