How to create Web sites easily

The most complete guide for the Web page builder
All you'll
ever need to know about homepages and HTML

Sounds, background music and counters

Click here to return to the index

Sounds

Question posted by Cindy. Thanks to you for helping me!

This will be short. Do you know how to put links? Then you know how to put sounds on your page. Just put the name of the sound file instead of a HTML page.

Browsers usually accept .AU format, .WAV format and .MID format for sounds and music. The sound will be played when the user clicks on the link referencing the sound

Down on this page is the info for background music (music that plays automatically, and does not need to be clicked on to hear).

For example:

<A HREF="landscape.mid">Click me to hear some music!</A>
would give you a link like this: Click me to hear some music!, linked to "landscape.mid". Try it! You can go to my MIDI page and then try all the songs I've got in there. As I have said, you can put a graphic instead of some text as a hyperlink. Look at this example:
<A HREF="landscape.mid"><IMG src="music_icon.gif" BORDER=0></A>
this is a hyperlink graphic, linking to "landscape.mid".

If you find it hard to figure out how to specify a file name, click here.

Background music?

This approach only works on Internet Explorer and WebTV (and, of course, all compatible MSIE browsers), though it requires only one tag, and it's easier to implement

Have you ever heard a page with background music (my MIDI page, for example, has it)? Well, we are going to learn how to use the background sound tag: <BGSOUND>. It does not have any ending tag. If you want to put "music.mid" as the background music in your page, do as follows:

<BGSOUND SRC="music.mid" LOOP=1>
This tag goes AFTER the <BODY> tag in your document. You can leave the LOOP= argument out; it's used to assign the number of times that the background sound is played. Specifying LOOP=INFINITE will cause the sound to be repeated in an endless loop.

Figure out how to specify file names on other servers by going here.

This other approach will work on almost any browser. It needs more work. Posted by The Omega. And a PUBLIC thanks a lot! for your support. You got your link!
URL: http://www.oocities.org/Area51/Corridor/4381

Message: I searched your page for the word embed, and only got one hit (about embedded frames), so you probably don't have this.

<BGSOUND> will only work on IE and WebTV, as far as I know. If you want your sound heard by everyone else, you need <EMBED>.

The format of the <EMBED> tag is:

<EMBED SRC="filename.mid" HEIGHT=60 WIDTH=144
AUTOSTART=[true/false] LOOP=[true/false] HIDDEN=[true/false]>

SRC defines the sound file, just like in the <IMG> tag. This is the only required option. You can use .AU (recommended for wave files), .WAV and .MID music files.

HEIGHT=60, WIDTH=144 defines the height and width of the control panel. The values given are probably the best. If you use the HIDDEN option, do not use these.

AUTOSTART=true if you want it to play upon loading, =false or omit if not.

LOOP=true if you want it to repeat, =false or omit if not.

HIDDEN=true if you want no control panel, =false or omit if you do want one. I recommend against using this option, since many songs get annoying after 3 or 4 repetitions. If it's not hidden, it can be stopped!

NOTE: Many browsers need a plugin for MIDI files to be installed on your system before you use this tag on your page!!! For example, if control panel is disabled (HIDDEN=TRUE), Internet Explorer will play the MIDI file without problems, however if you didn't install any plugins, when it attempts to load a page with a control panel (HIDDEN=FALSE) for the background music, it will not play the MIDI file and instead show a little empty box with a colored cube in it... pretty strange, when it could at least invoke Media Player...

And what if I want both Netscape and Internet Explorer to play the song?

Then use the following code:

<BGSOUND src="yourmusictitle.mid" loop="2">
<embed src="yourmusictitle.mid" autostart="true" loop="2" hidden="true"
volume="75" width="2" height="2" align="absmiddle">
Be careful to specify the same MIDI song on the two tags ("yourmusictitle.mid"). As for the LOOP= arguments, they must say the same (i.e. both INFINITE or both 1). The control panel in the <EMBED> tag must be hidden too (HIDDEN=TRUE).

How to put web counters on your page

This information applies only to GeoCities homesteaders. In most of the cases, for other persons, it will be similar, but please check your Web page provider's help for it. Try to go to:

Question posted by Saran Maitreiwech. Thanks to you for helping me!

Now that you know how to include a graphic in a document (you did see how to do it, didn't you?) you know how to include a web counter too. In GeoCities, first thing you have to do is initialize the counter. Do it the following way: point your browser to

http://www.oocities.org/cgi-bin/counter/name.password
where name and password represent the user name and the password, respectively. Now, to include a counter in your page, put an IMG SRC statement with the URL pointing to /cgi-bin/counter/name, where name... well, I guess you know that already. That's all!

For example: a user named andrea wants to put a counter on its page. Her password is powerful. To initialize her counter, she points her browser to

http://www.oocities.org/cgi-bin/counter/andrea.powerful
and in his page she would put this code:
<IMG SRC="/cgi-bin/counter/andrea">

If anything of this information proves not to work, please see the More information page and send me feedback, and I'll update my references to serve you better. Thanks!

Internet Link Exchange
Member of the ILE Free Home Pages at GeoCities


[Main page] [HTML help] [MIDI page] [Murphy's Laws] [More information]
[Feedback form to email me] [Sign guestbook] [Mail me!]