In this blog i told you about how to Use of Audio and Animation on Web Page.
     There are two types of adding audio and animation to webpage.
         i) Webpage that continuously plays a background sound for specific number of times without controls.
         ii)Webpage that plays a sound continuously with controls.

1.Webpage that continuously plays a background sound for specific number of times without controls.
       1. Open notepad and type following html code or you can copy from here.
<html>
<head><title>Audio Files</title>
</head>
<body bgcolor=wheat text=maroon>
<center>
<h1>To Display Audio Files Without Control<br><br>
<br><bgsound src="Hero.mp3"loop=3>
</body></html>

        2. After copying this html code save the file using .htm or .html extension.
        3. After saving this file open the file in internet explorer or fire fox or google chrome browser.
       4. You will get following output. In this output background sound plays as you visit website.
Output:

Note That: The mp3 file which you wants to play as background music must present in that folder where you are saving this file or give file path in html code.


2.Webpage that plays a sound continuously with controls.
   
       1.Open notepad and type the following html code as follows or you can copy html code from here.


<html>
<head><title>Audio Files With Control</title>
</head>
<body bgcolor=wheat text=maroon>
<center>
<h1>To Display Audio Files with Control<br><br>
<br><embed src="Hero.mp3"loop=3 height=150 width=200>
</body></html>



2. After copying this html code save the file using .htm or .html extension.
3. After saving this file open the file in internet explorer or fire fox or google chrome browser.
4. You will get following output. In this output the background sound plays with controls. You can play or pause sound.

Output:


Note That: The mp3 file which you wants to play as background music must present in that folder where you are saving this file or give file path in html code.
        
    Thank You.
     

Post a Comment

Previous Post Next Post