PDA

View Full Version : I need help: Adding Sound To Your Website?


Salahudin
22-01-03, 12:30 AM
Asalaamu Alaykum Wr Wb

can you guyz tell me how I can add a background sound to a website!

I have some applets but they only work with a .au sound file

I don't know how to change .ram or .wav to .au?

Jazakallahu Khayr!

baba
25-01-03, 11:23 AM
I've ripped this code from Dreamweaver.

Put this before the </head> tag on your HTML page:

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_controlSound(x, _sndObj, sndFile) { //v3.0
var i, method = "", sndObj = eval(_sndObj);
if (sndObj != null) {
if (navigator.appName == 'Netscape') method = "play";
else {
if (window.MM_WMP == null) {
window.MM_WMP = false;
for(i in sndObj) if (i == "ActiveMovie") {
window.MM_WMP = true; break;
} }
if (window.MM_WMP) method = "play";
else if (sndObj.FileName) method = "run";
} }
if (method) eval(_sndObj+"."+method+"()");
else window.location = sndFile;
}
//-->
</script> Then change your body tag and add an "onLoad" section to the end - for example:

<body bgcolor="#000000" text="#00CCFF" link="#9999FF"
onLoad="MM_controlSound('play','document.CS786','monkey.wm a')"> 'monkey.wma' is the filename of the sound you want to play in the background (if it's not uploaded to the same directory as your HTML page, then put the full path to the sound file in)

And then put this right at the end of your HTML page before the </body> tag:

<EMBED NAME='CS786' SRC='monkey.wma' LOOP=false
AUTOSTART=false MASTERSOUND HIDDEN=true WIDTH=0 HEIGHT=0></EMBED> Of course, 'monkey.wma' will have to be replaced again with the path to your sound file.

Salahudin
27-01-03, 03:11 AM
U DA MAN!!