code for sound?

  gurggles 19:51 26 Mar 2004

Hi, can anybody tell me what the correct coding is to insert sound onto a web page?
The coding must validate and be XHTML compliant, i have tried these and although the bottom one works, i.e. it plays the sound when the page is opened it does n't validate?
I have also looked on numerous web sites but to no avail.
object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
; ;param name="AutoStart" value="0" />
param name="ShowControls" value="1" />
param name="A:\blabla.wav" value="sounds/A:\blabla.wav" />

p> embed src= "A:\blabla.wav"
autostart ="true"
hidden = "true">


  PurplePenny 14:54 27 Mar 2004

"embed" won't validate because it is not standard XHTML. W3C recommend using "object".

Have you looked at the W3Schools site, they have a tutorial on sounds:

click here


  gurggles 23:09 27 Mar 2004

thanks purplepenny.iv tried a few forums and your the only answer so far.I will try object and have a look at the web site.

  Ben Avery 13:24 29 Mar 2004

Just to ensure you know, you would need to remove the "A:\" bit when you upload it as that refers to (usually) a floppy disk drive. Upload the sound to the same folder as the webpage and then it should work when you get the code.


  Ben Avery 13:45 29 Mar 2004

doesn't this work for you?

<EMBED SRC="Testsound.wav" width=1 height =1 hidden=true autostart=true loop=false>

where "Testsound.wav" is the name of the file.

I've uploaded a blank page using this theory here for you to try using a file named "Intro.mp3" click here


  gurggles 15:00 29 Mar 2004

thanks ben avery&purplepenny,the object code works as did the embed which i tried earlier but so far only the object code validates using xhtml.
I will soldier on till i am able, too not show the little player when the web page opens.Hopefully i will be able to reduce some of the files because since adding the sound the page has been slower loading.Unfortunately since it is an assessment that i am doing i must add the sound files on the page.thanks again for help.

  Ben Avery 15:25 29 Mar 2004

using the one I uploaded is a start in that the player is hidden. However, I don't understand the "Validating" thing so I will wish you all the best on you success and leave it at that!

  Ben Avery 15:29 29 Mar 2004

I'm sure someone will coorect me if I'm wrong, but I believe that mp3 files can load after the page in the sense that, after the page loads, the mp3 files loads "as it play" reducing load times of the page compared to if you had to load the whole audio file before the page shows.

Does that make sense?

I believe it is called "streaming audio"???


  gurggles 22:06 29 Mar 2004

Hi ben will try mp3 to see if they are faster.The validating is on the click here site and has to validate for xhtml compliant rather than html which is a looser format!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

AMD Radeon Adrenalin release date, new features, compatible graphics cards

8 brilliant character artists speaking at Pictoplasma 2018

iMac Pro release date, UK price & specs

Football : comment regarder la Ligue 1 en direct ?