NEW

6/recent/ticker-posts

Header Ads Widget

HTML Audio Tag

 

HTML Audio Tag

HTML audio tag is used to define sounds such as music and other audio clips. Currently there are three supported file format for HTML 5 audio tag.

  1. mp3
  2. wav
  3. ogg

HTML5 supports <video> and <audio> controls. The Flash, Silverlight and similar technologies are used to play the multimedia items.

This table defines that which web browser supports which audio file format.

Browsermp3wavogg
ie browser Internet Exploreryesnono
chrome browser Google Chromeyesyesyes
firefox browser Mozilla Firefoxyes*yesyes
opera browser Operanoyesyes
safari browser Apple Safariyesyesno

HTML Audio Tag Example

Let's see the code to play mp3 file using HTML audio tag.


  1.   <audio controls>  <source src="koyal.mp3" type="audio/mpeg">  
  2. Your browser does not support the html audio tag.  
  3. </audio>  

Output:

Let's see the example to play ogg file using HTML audio tag.

  1. <audio controls>  
  2.   <source src="koyal.ogg" type="audio/ogg">  
  3. Your browser does not support the html audio tag.  
  4. </audio>  

Post a Comment

0 Comments

Recents Post

Exploring Paidwork - Your Gateway to Earning Online