BGSOUND

Description

The <BGSOUND> element allows authors to create pages that will play background sound clips, or background soundtracks while being viewed.

Syntax

<BGSOUND
BALANCE=n
CLASS=Style Sheet class name
ID=value
LANG=language
LOOP=n
SRC=url
TITLE=text
VOLUME=n
>

Parameter

Description

BALANCE

Determines how the available volume will be divided between the left and right speakers. Valid values for this attribute are in the range of -10,000 to +10,000, with 0 being "Wave Output" center balanced.

CLASS

Class of the tag being defined. This is used to associate a subclassed style sheet with the tag.

ID

SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Valid ID values must begin with a letter. The underscore character, "_", may be used in the ID name. The ID should be unique throughout the scope of the document. If more than one object with the same identifier exists in a document, a collection of those named items is created that can only be referenced by ordinal position.

LANG

Specifies which language to use in ISO standard language abbreviation form.

LOOP

Specifies how many times a sound will loop when activated.

SRC

Specifies the URL of a sound to be played.

TITLE

The TITLE attribute is for advisory information (unless used with a mailto: attribute). The Title attribute should provide the title of the document whose address is given by the HREF attribute. The contents of the title attribute will be displayed in a tooltip during the mouse moves on the link. Internet Explorer 4.0 (and above) is the only browser to implement this.

VOLUME

The VOLUME attribute accepts values between '-10000' and 0 and can be used to set the volume at which the sound file will play.
Note that using '0' (i.e. maximum volume), will play the sound file at 100% of the users current volume settings. There is no way in HTML that you can force a sound file to play at a volume indecent to the user. They will always have total control.

 

Example

<BGSOUND src="../my_documents/sound/titanic.mid">

Remarks

This element may be used within the HEAD tag. The start tag is required, and the end tag is optional.

Sounds can either be samples (.WAV or .AU format) or MIDI (.MID format).