<bgsound src="../files-music/midi/winniethepooh.mid" loop=6>

SOUND TAGS FOR MSNTV & COMPUTERS


Nov, 2001; Oct, 2002 - please note: All sound tag tests were done with a Sony Plus and a Philips Magnavox Plus and the 2.6.1 and 2.7 updates. Last updated: Oct 25, 2002.

BGSOUND TAG FOR MSNTV & INTERNET EXPLORER


This is the simplest tag to use. All you need to type is the following:

<bgsound src="URLofsong.mid">


This tag will cause the midi to play one time from start to finish as soon as the page loads. There will be no visible clickable buttons to use to start and stop the sound.

If you wish to have the song play longer than one time through, then you must add the loop attribute to the tag. You can specify the number of times you want the midi to play, using a number such as 2 or 3:


<bgsound src="URLofsong.mid" loop=2>



EMBED TAG FOR MSNTV & NETSCAPE


Now we'll consider the embed tag. Both of these tags will work with MSNTV, but if your page is also for computer users, you must use BOTH of these sound tags! (see below) Let's start with the basic tag:

<embed src="URLofsong.mid">


If you use the embed tag by itself with no attributes added, a clickable button will appear. These words (in light green text) will apear above the button: Select to start. Clicking the button will produce the song. But suppose you want the sound to start automatically with no button showing? Then you must add these attributes:

<embed src="URLofsong.mid" autostart=true hidden=true>


You may also add the loop attribute, as with the bgsound tag. It works exactly the same as it does in the bgsound tag. Some people close this embed tag for sound. With MSNTV is is not necessary, but you may use it if you wish:

</embed>


I have tested the loop=-1 attribute with all the sound file types: au (.au), midi (.mid), mod (.mod), Rich Music Format (.rmf), s3m (.s3m) and wav (.wav), except for the Real Audio. All sound file types listed above work with the loop=-1.


PLACEMENT OF SOUND TAGS ON PAGE


Since users of MSNTV ought to put a Javascript reload warning on their pages to counteract the MSNTV JS bug that plagues the browser, please note the following:

After the body tag, place the reload tags. THEN place the sound tags. If you place the sound tags before the reload warning tags, then MSNTV users MAY have to reload more than once to make the sound play! This has been happening with the 2.7 update.

NOTE: Since computer users will see your reload warning, and will not b able to see MSNTV pages properly if you have used the gradient color and audioscope tags, it is best to also suggest to a computer user to download the MSNTV Viewer, so they can see your page properly. The url for the MSNTV/WebTV Viewer is http://developer.msntv.com/Tools/WebTVVwr.sp



SOUND TAGS FOR COMPUTERS


If you are making webpages to be viewed by computers as well as by MSNTV, you must use both sound tags, one right after the other. Some browsers will read one tag, others will read the other and ignore the first. The bgsound tag works as above, with the exception of the loop attribute. For both the bgsound and the embed tags, instead of using "-1" for the loop, you must use a positive number (no minus sign), if you want the song to repeat.

With the embed tag, you should also use the attribute called "hidden." Some versions of Internet Explorer will produce a pop-up control panel in the middle of the screen if you leave out the hidden attribute! So here's what you'll be putting on your page if you want computer users to hear music while they are reading your page:

<embed src="URLofsong.mid" autostart=true hidden=true loop=4> </embed>
<noembed><bgsound src="URLofsong.mid" loop=4></noembed>


It is necessary to use the noembed tags before the bgsound src tag, since Netscape does not translate this tag. Netscape will just ignore what's between the two noembed tags, while Internet Explorer will read this bgsound src tag. The sound tag that Netscape uses is the embed src tag.

WAV, AIFF & AU FILES FOR COMPUTERS


With MSNTV and with the computer browsers that recognize the BGSOUND tag, wav, aiiff and au files will loop according to specifications. But for computer browsers, no matter how low you set the number of loops for the EMBED tag, a wav, aiff or au sound file will loop endlessly! We are indebted to Tom Landum for supplying a Javascript solution that works for both MSNTV and computer browsers. For a song wav file, the number of times the song will loop doesn't matter so much. But if you have a wav, aiff or au file of a specific sound, like a duck quacking, you may want the quack to sound only 3-4 times, not endlessly.

<script> function play() { setTimeout("document.location='donald3.wav';",3000); setTimeout("document.location='donald3.wav';",6000); setTimeout("document.location='donald3.wav';",9000); } play(); </script> These settings are for a wav sound file that lasts for 3 seconds (3000 = 3 seconds). In this script, each 1000 equals one second. Notice that each setTimeout is 3000 more than the previous setting. You must continue to add 3000 each time you add to the setTimeout, as the seconds are cumulative. You must time your wav (or aiff or au) sound file to get the proper number of seconds. Four seconds equals 4000, and so on.


SEQUENTIAL SONGS ON A PAGE


This works for computers with browsers that read the bgsound tag: Use one meta tag in the head for each ensuing song. Measure the number of seconds for each song, and add this to the number in the content attribute. Actual time is usually longer than the time entered, due to file loading time. Preloading the song urls makes the actual time nearer to this value.

This tag goes in the page's head tag:

<head>
<meta http-equiv="refresh" content="1;url=song.mid">(one tag for each song)
</head>

Then place this tag in either the head or the body:

<bgsound src="song2.mid">

For MSNTV you can have only ONE meta refresh tag in the head. If you put more than one meta refresh tag in the head, then the bgsound tag will play first, but only the last listed meta tag song will play next. The MSNTV browser ignores the other meta refresh tags.

For an example of two sequential sound files in action, go to "Hitchcock and the Chickens".

Cedesign's Sound Tute
Lots of examples, including the various buttons, start, stop, etc; plus all the codes to copy. I haven't tried some of these codes, so don't know whether they'll all work for MSNTV.

Tyhart's Tute for Sequential Sounds on a Page
Here's a JS script for getting more than two sounds per page for MSNTV. This method works fairly well. But due to the vagaries of how the MSNTV browser loads a page, sometimes a longer song will get cut off. But that's a small price to pay if you want more than two songs/sounds per webpage. This does not work with email or newsgroup posts.


CONTROL PANELS FOR MSNTV


Thanks to Glimermann, MSNTV users can now put one or more control panels on webpages. Each panel will control one song: start, pause, stop and raise or lower the volume. For further information, go to Sound Control Panels. You will be able to source the codes for this page directly at Thunderstone.

UNZIPPING SOUND FILES FOR MSNTV


The Dream Server's and Domania's File Managers now have a new feature, called G-zip, which does zip up (and unzip) sound, text and image files that the 2.7 MSNTV users can hear and see. Although The Zone does offer this feature, too, I am told that the server sometimes doesn't translate those files properly so they can be heard and seen.

The above File Managers also do the regular zipping and unzipping of files. I do not know about any other File Managers.

CONTINUOUS MUSIC FROM PAGE TO PAGE


Sammi has written an excellent tutorial on getting the same music to play continuously, without interruption, when a viewer moves from one page to the next on a website. This method uses frames, but never fear, her tutorial is very easy to follow and understand.

Tandem Tooters ~ ~ Table That Tune ~ ~ Tone By Tone Dot Net
Midi playing is "Winnie the Pooh"