Collection of references for web development.

HTML audio tag


The HTML <audio> element is used to embed sound in the document.


Attribute Value Description
autoplay boolean Specifies whether the media source should automatically play or not.
buffered TimeRanges Object Determines which time ranges of the media have been buffered.
controls boolean Specifies whether the browser should show controls for the user.
loop boolean If true, the media will continuously start from beginning when it has reached its end.
muted boolean Specifies whether the media should be silenced or not.
played TimeRanges Object Determines the time ranges of the media that have been played.
preload auto
Specifies how the author will think how the media should be loaded.
src URL The URL of the file to embed in the document.
volume From 0.0 (silent) to 1.0 (loudest) Specifies the playback volume, from silent to loudest.


<audio src="" controls>
	Your browser does not support the audio element.

Example #2

<p>Fallback Example</p>
<audio controls>
	<source src="" type="audio/ogg; codecs=opus">
	<source src="" type="audio/ogg; codecs=vorbis">
	<source src="" type="audio/mpeg">