Music is one of life’s greatest pleasures. Everyone loves music, myself included, and to be able to add that to a website is something I adore and want to get more familiar with. So here is some information on it.
The <audio> tag creates an interactive interface that plays an audio clip.
Here is some example HTML for the base of the element.
The tag also has some attributes that can be added to it. These options help customize the audio to be compatible to the users’ needs. A couple of these attributes are auto play, and mute.
Both these attributes are fairly straightforward. Adding auto play allows the audio to be automatically played when the window is opened, not requiring direct play/pause interaction.
Here is an example of auto play HTML
The mute attribute sets the audio to be muted from the start, so if paired with auto play the audio will play but not make sound. This of course can be undone by the viewer if and when they want to hear the audio.
Here is an example of mute HTML
There are three audio formats that are supported by most of the popular browsers; MP3, WAV, and OGG
Some Tag Definitions
<audio> Defines the sound content
<source> Defines multiple media resources for media elements