C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
HTML Audio TagHTML 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.
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.
HTML Audio Tag ExampleLet's see the code to play mp3 file using HTML audio tag. <audio controls> <source src="koyal.mp3" type="audio/mpeg"> Your browser does not support the html audio tag. </audio> Output: Let's see the example to play ogg file using HTML audio tag. <audio controls> <source src="koyal.ogg" type="audio/ogg"> Your browser does not support the html audio tag. </audio> Supporting Browsers
Attributes of HTML Audio TagThere is given a list of HTML audio tag.
HTML Audio Tag Attribute ExampleHere we are going to use controls, autoplay, loop and src attributes of HTML audio tag. <audio controls autoplay loop> <source src="koyal.mp3" type="audio/mpeg"></audio> MIME Types for HTML Audio formatThe available MIME type HTML audio tag is given below.
Next TopicHTML video
|