Solved

script for playing music

Posted on 1998-08-27
5
184 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
[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
  • Learn & ask questions
  • 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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is the optimum percentage to save images for webs. 4 49
How to post data to an API using ASP Classic 3 51
compare date to getdate() 8 34
PDF Turn Look 7 36
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
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…
The viewer will learn how to dynamically set the form action using jQuery.

751 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