References
Collection of references for web development.
HTML audio tag
Description
The HTML <audio> element is used to embed sound in the document.
Attributes
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 metadata none |
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. |
Example
<audio src="https://codeshack.io/web/example.ogg" controls>
Your browser does not support the audio element.
</audio>
Example #2
<p>Fallback Example</p>
<audio controls>
<source src="https://codeshack.io/web/example.opus" type="audio/ogg; codecs=opus">
<source src="https://codeshack.io/web/example.ogg" type="audio/ogg; codecs=vorbis">
<source src="https://codeshack.io/web/example.mp3" type="audio/mpeg">
</audio>
<!-->
<!DOCTYPE>
<a>
<abbr>
<address>
<area>
<article>
<aside>
<audio>
<b>
<base>
<bdi>
<bdo>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<cite>
<code>
<col>
<colgroup>
<data>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<footer>
<form>
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<meta>
<meter>
<nav>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<picture>
<pre>
<progress>
<q>
<rp>
<rt>
<rtc>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<template>
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<u>
<ul>
<var>
<video>
<wbr>
accept
accept-charset
action
allowfullscreen
alt
as
async
autocomplete
autofocus
autoplay
buffered
capture
charset
checked
cite (attr)
cols
colspan
content
controls
coords
crossorigin
data (object)
datetime
decoding
default
defer
dir
disabled
download
enctype
for
form (attr)
formaction
formenctype
formmethod
formnovalidate
formtarget
headers
height
high
href
hreflang
http-equiv
integrity
ismap
kind
label (attr)
label (track)
list
longdesc
loop
low
max
maxlength
media
method
min
minlength
multiple
muted
name
name (meta)
nonce
novalidate
open
optimum
pattern
ping
placeholder
played
playsinline
poster
preload
readonly
rel
required
reversed
rows
rowspan
sandbox
scope
selected
selectionDirection
selectionEnd
selectionStart
shape
size
sizes
span (col)
src
srcdoc
srclang
srcset
start
step
target
text
type
type (button)
type (input)
type (list)
type (object)
typemustmatch
usemap
value
volume
width
wrap
xmlns
onabort
onafterprint
onanimationcancel
onanimationend
onanimationiteration
onbeforeprint
onbeforeunload
onblur
oncanplay
oncanplaythrough
onchange
onclick
oncontextmenu
oncopy
oncuechange
oncut
ondblclick
ondrag
ondragend
ondragenter
ondragleave
ondragover
ondragstart
ondrop
ondurationchange
onemptied
onended
onerror
onfocus
onhashchange
oninput
oninvalid
onkeydown
onkeypress
onkeyup
onload
onloadeddata
onloadedmetadata
onloadstart
onmessage
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup
onoffline
ononline
onpagehide
onpageshow
onpaste
onpause
onplay
onplaying
onpopstate
onprogress
onratechange
onredo
onreset
onresize
onscroll
onsearch
onseeked
onseeking
onselect
onstalled
onstorage
onsubmit
onsuspend
ontimeupdate
ontoggle
ontouchcancel
ontouchmove
ontouchstart
ontransitioncancel
ontransitionend
onundo
onunload
onvolumechange
onwaiting
onwheel