HTML | Tags and Attributes [Multimedia] [Add Audio/Sound]




Ü Attaching sound file : There are two tags to add an audio file to a HTML document. First one is as follows,
          <BGSOUND SRC="…..">
The value of the SRC attribute will be the location of the sound file. We will have to use that tag after the </HEAD> tag and before the <BODY> tag as follows,
<HTML> <HEAD><TITLE>Others</TITLE></HEAD>
<BGSOUND SRC="……">
<BODY>
</BODY></HTML>
When adding sound files like this, the sound will be playing at background; there will be no control on the sound.
Second process
to add sound is as follows,
            <EMBED SRC=”…” AUTOSTART=”..” HEIGHT=”..” WIDTH=”..” LOOP=”..” ALIGN=”..” HIDDEN=”..  ”>

Attribute
Description
SRC=”..”
The value of SRC attribute specifies the sound file location.
AUTOSTART=”..”
The values of AUTOSTART attribute are TRUE and FALSE, which specifies that the sound will start automatically or not.
HEIGHT=”..”
It specifies the height of sound control box.
WIDTH=”..”
It specifies the width of sound control box.
ALIGN=”..”
It is used to align the sound control box., values are LEFT, RIGHT, CENTER, ABSBOTTOM, ABSMIDDLE, BOTTOM, BASELINE, TEXTTOP and TOP
HIDDEN=”..”
It specifies the visibility of the sound control box. Values are TRUE and FALSE.
LOOP=”..”
Specifies the number of times the background sound will be repeated. By default it has INFINITE value, which means the sound will be repeated for infinite time.


Now consider the following input and the output to understand,
Input :
<HTML> <HEAD><TITLE>Others</TITLE></HEAD>
<BODY>
<CENTER><H1>Adding sound to a HTML page........<H1>
<EMBED SRC="green17.wav" AUTOSTART=TRUE LOOP=5 HEIGHT=28 WIDTH=400 HIDDEN=FALSE>
</CENTER>
</BODY>
</HTML>
Output :


Recommended Recommends

Comments

Contact Us

Loading...