Home | E-mail
HTML Basics - Part 9 of 12 by Matthew Bacon
Sound FX To really grab your viewers attention, it is possible to play samples and MIDI files on your web pages :-) To trigger an audio file (WAV format recommended), the `<BGSOUND>` tag is used. The tag should appear within the head section of your page, not the body as you might expect. The attributes of `<BGSOUND>` are `SRC=""`, `LOOP=` and `DELAY=`. For example,
    <HTML>
            <HEAD>
            <TITLE>This is a noisy page</TITLE>
            <BGSOUND SRC="audio.wav" LOOP=6 DELAY=2>
            </HEAD>
            <BODY>
            Do you like my sample?
            </BODY>
            <ADDRESS>
            This page was written by Matthew Bacon
            </ADDRESS>
    </HTML>
In the example above, the audio file, `AUDIO.WAV` is looped six times with a delay of 2 seconds between each loop. Sound effects can help draw your readers attention to your page (the `<BGSOUND>` tag is automatically triggered when your page is downloaded), but are not recommend for everyday use. Special occasions only!
Previous | Next
MyAtari magazine - Tutorial #9, April 2001 | Contents Features Reviews Tutorials Regulars Adverts
[ Top of page ]
Copyright © 2001 MyAtari