Unofficial Tips and Tutorials for Homestead SiteBuilder™ Users


Home - Tips & Tutorials - JavaScript Demos - Java Applet Demos - Resources - Contact

Embedding Background Sounds and Playable-on-Page MP3 Link >>>

These are the same HTML codes featured on my Homestead page for using the sound elements. If you want to use a .wav for a mouseover or mouse click on a graphic or text, go to the Script page. A variation of the background sound HTML is the DHTML Script which incorporates the HTML you see to the right. You can find it here.

HTML Code

Here's the HTML for putting a midi or other sound on your page. Paste this code in an Insert HTML element and place anywhere on the page. If you're putting this code in a non-Sitebuilder page, you can put this in the body anywhere after the <body> tag, depending on how your page editor works.

<embed src="files/sound.mid" autostart="true" loop="true" hidden="true">
<noembed>
<bgsound src="files/sound.mid" loop="infinite">
</noembed>

If you do not want the sound to start at page loading, change autostart to "false".

If you do not want the sound to repeat itself change the 1st loop command to "false" and the second loop command to "1" (for play one time).

If you want a visible player, change the hidden to "false" or leave the command out.

If src="files/sound.mid" does not work, use your full URL instead, as in "http://yoursite.homestead.com/files/sound.mid".

This is the basic HTML that's supposed to work for both IE and NS. What kind of player appears depends on what a visitor sets as a default player for certain filetypes.

Create a Link to AutoPlay MP3

Believe it or not, it's as simple as putting a link code on your page. Use the Insert HTML element and paste this code. Change "First Song" to any text such as the title of the song, a number, whatever.

<a href="http://yoursite.homestead.com/files/music1.mp3" type="audio/mpeg">First Song</a>

This will automatically start up the file using the visitor's default player for mp3s.

Tip

Although it's not necessary, you can provide links to the download page of whatever sound player your visitor should be using depending on the sound type. Whether it's WindowsMedia Player, RealPlayer, Quicktime, or whatever, providing a link to those visitors who may not have one installed is an added plus. A sound player that's offered in various operating systems and browsers would be ideal.

Formerly hosted at
www.geocities.com/ramblingtutor/

Home - Tips & Tutorials - JavaScript Demos - Java Demos - Resources - Contact

Webpage graphics by Arride Graphics
Copyright © 2000- Rambling Tutor and JanetS
All Rights Reserved
All other copyrights belong to their respective owners as noted.


Plus 260 visitors before joining Site Meter on June 11, 2001