|
To begin, download at least 3 midi files from Google search engine, midi+files. Select at least three Midi files and copy these files in the same directory on your PC.
Next, create a blank HTML document and place it in the same directory.
Copy the following Javascript and paste it between the <head> </head> Tags of the HTML document you created.
<script>
<!--
//By George Chiang (http://www.freewarejava.com/)
More JavaScripts here!
var sound1="woeisme.mid"
var sound2="645jazz.mid"
var sound3="echoes.mid"
var x=Math.random()*10
if (x<=3) x=sound1
else if (x<=6) x=sound2
else
x=sound3
if (navigator.appName=="Microsoft Internet
Explorer")
document.write('<bgsound
src='+'"'+x+'"'+'
loop="infinite">')
else
document.write('<embed
src='+'"'+x+'"'+'hidden="true"
border="0" width="20" height="20"
autostart="true" loop="false">')
//-->
</script>
Change my Midi file names: woeisme.mid, 645jazz.mid and echoes.mid to match your Midi file names.
You can add as many sound files to this script as you
want.
If you are new to JavaScript, I recommend you learn from an
expert. Visit
Introduction to JavaScript from W3schools.com.
|