HTML 5 comes with a standard way of embedding audio files as previously we don’t have any such support on a web page. Supported audio formats are as follows:
MP3
Wav
Ogg.
Syntax:
Description:
src value can be relative as well as absolute URL. We can also use multiple elements pointing to different audio files.
controls – it adds controls such as volume, play and pause.
autoplay – it’s a boolean value which specifies that audio will start playing once it’s ready.
loop – it’s also a boolean value which specifies looping (means it automatically start playing after it ends).
preload – auto, metadata and none are the possible values for this attribute.
auto means plays as it loaded.
metadata displays audio file’s associated data
none means not pre-loaded.