Image of Html5 Icons.

Html5 Audio Element

Before Html5, adding sound to a web page required third-party components like Adobe Flash player and Apple's Quick Time. Html5 audio element didn't change that method, but at least it offers another if not better option.

HTML5 AUDIO ATTRIBUTES

Audio files cannot display sound controls without related attributes of the audio element. There are several attributes that can be used with the audio element to increase its functionality.

SOURCE

The audio source attribute can also be used as an independent self closing element to include different audio files format to ensure cross browser support for all of your audio files.

CONTROLS

This attribute brings Html5 native audio in to view. It display the browser default audio controls that allow users to interact and manipulate the media player sound.

PRELOAD

Preload give the browser an idea of the amount of audio it needs to load. This attribute can use three different values.

HTML5 AUDIO META DATA

LOOP: With this attribute, you can play an audio file in a constant loop the automatically restart itself without stopping.

MUTED: This is used to pause the audio player, but the attribute is not currently supported by any browser. Until then, its practically useless. However it's purpose is obvious.