integrating sound

  vienna1981 15:40 01 Nov 2003
Locked

hi, how do i integrate an mp3 file to play when someone visits my website? I use html code via notepad to build my site. Thanks in advance

  Taran 16:08 01 Nov 2003

For a start I'd suggest a midi file to keep the file size down. I'd also suggest that you rethink the idea on the whole. Sound on web pages is one of those things that you either love or hate.

Guess which bracket I fall into ?

Assuming your file is a midi file and is called bgsound (stands for back ground sound) you can use the following code:

<embed src="bgsound.mid" hidden="true" autostart="true" loop="1">
<noembed>Your browser doesn't support EMBED, but you can still listen to the background sound of this page by a href="bgsound.mid" clicking here.</a></noembed>

I've removed the <>from the a href= link to allow it to display in this page properly.

src="" is the source of the sound file - this is the filename and the folder it lives in in your web.

autostart="true" tells the web browser to start playing the file as soon as it is loaded or setting the value to false means your visitor can choose whether or not to listen to it by clicking the hyperlink you provide for them.

loop="1" plays the sound once. You can either use a number to specify how many times the sound plays, or you can use true or false.

Hope this helps.

Regards

Taran

  Taran 16:19 01 Nov 2003

I forgot to add that the <EMBED> tag is not always correctly interpreted by Internet Explorer.

Its IE equivalent <BGSOUND> is similarly difficult for NetScape to deal with.

Most up to date browsers will cope with either, but anyone using older web browsers can have serious problems, which is another compelling reason to avoid embedded sound files in your web pages...

It's only fair that I warn you.

T

  vienna1981 17:03 01 Nov 2003

thanks for your help...i'll think it over before i decide...

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

Elsewhere on IDG sites

Xiaomi Mi Mix 2 review

What went wrong at the Designs of the Year 2017

iPhone X news: Release date, price, new features & specs

Comment regarder des séries et talk-shows américains en France ?