Thursday, January 11, 2018

How To Use Audio Tag In Html

Here In This Html Tutorial We Will Show The Functionality Related To Audio Tag.When writing in HTML, the <audio> tag is an inline element used to embed sound files into a web page. It is useful when you want to add any audio, such as a song or interview, to your web pages. The following sections contain information about this tag, including an example of it in use, as well as related attributes and browser compatibility.Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <audio> tag, as well as a description of each.The HTML <audio> element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source>element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.It is recommended that both height and width to be directly proportional to avoid problems.

To hide the player the value of the hidden attribute (which is false at the moment) will be replaced by true. This thing is done if you are absolutely sure that the user does not wish to stop the sound.The HTML <audio> tag is used to embed audio in web pages.he HTML <audio> tag is used to specify audio on an HTML document.HTML tags can contain one or more attributes. Attributes are added to a tag to provide the browser with more information about how the tag should appear or behave. Attributes consist of a name and a value separated by an equals (=) sign, with the value surrounded by double quotes. Here's an example, style="color:black;".In our series on HTML5, we've discussed geolocation, link relations, form and keyboard events, media events, mouse events, global attributes and multimedia. This week we're going to expand upon our discussion on multimedia and delve further into HTML5's <audio> tag.The <audio> tag is new to HTML, like the <video> tag, and allows developers to embed music on their websites (and unlike earlier attempts to add audio to a website, it isn't limited to old-fashioned midi music). That said, it does have limitations on the types of files that can be used. Currently any recent browser that is based on Webkit, such as Chrome and Safari, supports the use of regular .mp3 files. Others, such as Firefox, only support the .ogg format.The good news is that you can either convert your files from .mp3 to .ogg (one audio conversion tool, media.io, can be used online) or just supply two versions of your audio file, one in each format. When Safari, for instance, comes across the <audio> tag, it will ignore the .mp3 file and move directly to the .ogg file.In HTML5, there are 3 supported audio formats: MP3, Wav, and Ogg.The Tag Is Shown As, <audio> Tag.

Here Is An Example Related To <audio> Tag.

Step 1 :

<!DOCTYPE html>
<html>
<body>

<audio controls>
  <source src="Kick.ogg" type="audio/ogg">
  <source src="Kick.mp3" type="audio/mpeg">

</audio>

</body>

</html>

Output :



No comments:

Post a Comment

How To Create Image Gallery In Html

Hello Friend My Name Is Viraj,Today I Will Create Image Gallery And Display On A Webpage.The emergence of CSS3 technology has enabled web d...