The <audio> Element
Technical Summary
audio is an embedded-content element whose media data is ostensibly audio. It participates in the shared HTMLMediaElement processing model used for resource selection, network and ready states, the media timeline, playback promises, and media events.
The HTML Standard permits both audio and video to handle media containing audio and video. Their main difference is that audio has no playback area for visual content such as video or captions. Keep normative processing, browser policy, codec support, native controls, and accessibility API observations as separate evidence.
Definition / Categories
| Item | Definition |
|---|---|
| Meaning | Plays a media resource whose data is ostensibly audio in a document |
| Categories | Flow, phrasing, and embedded content. With controls, it is also interactive and palpable content |
| Context | Where embedded content is expected |
| Content model | The presence of src changes whether child source elements are allowed and their order. Both forms allow zero or more track elements followed by transparent content, but no descendant media elements |
| Tag omission | Neither the start tag nor the end tag can be omitted |
| Content attributes | Global attributes, src, crossorigin, preload, autoplay, loop, muted, controls, and loading |
| DOM interface | HTMLAudioElement, which inherits from HTMLMediaElement |
Content model and resource selection
Whether an audio element has a src attribute determines which child elements are permitted. When using child source elements, list candidates in document order and provide a type when known.
| Condition | Child model | Boundary |
|---|---|---|
With src | Zero or more track elements, followed by transparent content | No child source elements |
Without src | Zero or more source elements, zero or more track elements, then transparent content | Transparent content cannot contain descendant media elements |
<audio controls preload="metadata">
<source src="/media/lesson.ogg" type="audio/ogg; codecs=opus">
<source src="/media/lesson.mp3" type="audio/mpeg">
This browser does not support the audio element.
<a href="/media/lesson.mp3">Open the audio file</a>
</audio>
<p><a href="/transcripts/lesson.html">Read the transcript</a></p>
The type on a source is information that can help a user agent skip a candidate before fetching it. Declaring a MIME type does not establish that a container, codec, profile, server response, or network condition will allow playback. Also distinguish source selection inside picture from selection inside a media element.
Transparent content inside audio is for user agents that do not support the audio element. A browser that supports audio does not necessarily show that content when fetching or decoding a resource fails. Put a recovery link and transcript outside the element as well.
Attributes and loading boundaries
| Attribute | Role in the standard | Boundary |
|---|---|---|
src | URL of the media resource | When present, the child-source candidate model is not used |
crossorigin | Sets the CORS mode for the media request | Read with the resource response headers and credentials conditions |
preload | Author hint for expected fetching through none, metadata, or auto | Does not require the browser to honor the hint |
loading | Policy for deferring off-viewport media resources | When lazy, loading deferral takes precedence over preload; support and actual timing require implementation evidence |
autoplay | Requests automatic playback | User agents are not required to honor it; user preferences and playback policy can affect the result |
controls | Requests user-agent playback controls | Rendering, operation, and accessibility-tree details can vary by browser and platform |
muted / loop | Initial muted state / request to return to the start after playback ends | Distinguish attributes from current IDL state and actual playback permission |
type | Media type hint on a child source | Not a content attribute on audio |
Media state and playback requests
audio uses the same media processing model as video. The APIs below describe different states; they should not be collapsed into a single “loading percentage.”
| API / concept | What it observes | Boundary |
|---|---|---|
networkState | Resource selection and fetching | NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, and NETWORK_NO_SOURCE |
readyState | Availability of media data at the current position | HAVE_NOTHING through HAVE_ENOUGH_DATA; values need not change in sequence |
currentTime / duration | Position and length on the media timeline | Finite duration cannot be assumed for unknown or unbounded resources |
paused / ended | Playback processing state | Do not infer state only from the appearance of controls |
play() | Playback request and a Promise for its fulfillment or rejection | It can reject with NotAllowedError when the user agent does not allow playback |
| Events | loadstart, loadedmetadata, canplay, playing, pause, ended, and others | Events correspond to state changes; an application cannot assume every order or timing |
Changing the src or type of a child source after insertion is not a way to switch the current media resource. To explicitly change what is playing, update the media element's src and start resource selection; confirm the relationship with load() against the standard and implementation evidence.
Timed text and accessibility
A child track can specify external timed text associated with the media timeline. An audio playback area has no visual space for captions, so the presence of a track does not by itself provide a readable transcript. Separate the purpose of tracks such as chapters or metadata, the browser UI, and the actual alternatives available to users.
The 2026-09-23 Working Draft of HTML-AAM 1.0 gives audio the computed role html-audio and specifies how native controls are exposed through platform APIs. This is a specification mapping in a Working Draft. It is separate from measurements of a browser Accessibility Tree, platform API, or assistive-technology output.
WCAG 2.2 SC 1.2.1 requires an equivalent time-based media alternative for prerecorded audio-only media that falls within its scope, except when it is clearly labeled as a media alternative for text. This does not mean that the presence of an audio tag alone determines conformance. Distinguish this from caption criteria for prerecorded synchronized media and their own applicability conditions.
DOM Interface
| Interface / property | Role | Boundary |
|---|---|---|
HTMLAudioElement | Represents an audio element and inherits from HTMLMediaElement | Many resource-selection and playback APIs are defined on the parent interface |
Audio([src]) | Legacy factory function that creates an audio element | With a source, resource selection starts and preload is set to auto; this does not mean autoplay is allowed |
volume / muted | Read or set playback volume and muted state | Confirm browser, platform, and user-preference constraints through implementation evidence |
audioTracks | Access information about audio tracks in the resource | Do not assume multiple tracks or switching are available in every browser |
Fact / Evidence
Claims from the HTML Standard, HTML-AAM, and WCAG are paired with their scope and source. The HTML-AAM entry is labeled as a Working Draft; specification mappings and implementation observations remain separate.
| Type | Fact / claim | Conditions / scope | Status | Source |
|---|---|---|---|---|
| SPEC | audio is flow, phrasing, and embedded content; with controls, it is also interactive and palpable content. | Use where embedded content is expected. The DOM interface is HTMLAudioElement. | Reviewed | HTML Standard: the audio element |
| SPEC | The presence of src changes the order of source, track, and transparent content. | With src, the content model excludes child source elements; both models exclude descendant media elements. | Reviewed | HTML Standard: audio content model |
| SPEC | preload is a hint about expected fetching; loading deferral takes precedence when loading="lazy". | Actual fetching, viewport conditions, autoplay, and browser support are separate implementation questions. | Reviewed | HTML Standard: media loading attributes |
| SPEC | Resource selection, network / ready states, playback promises, and event processing are defined by the shared media model. | Keep play() rejection distinct from browser autoplay policy and resource decode errors. | Reviewed | HTML Standard: media elements |
| AAM | The HTML-AAM 1.0 Working Draft gives audio the computed role html-audio and defines platform role and native-control mappings. | Working Draft dated 2026-09-23. This is distinct from browser-tree, platform-API, and assistive-technology measurements. | Draft reviewed | HTML-AAM: audio |
| SPEC | WCAG 2.2 SC 1.2.1 requires an equivalent time-based media alternative for in-scope prerecorded audio-only media. | Exception: clearly labeled media alternatives for text. Conformance is not determined by the HTML element alone. | Reviewed | WCAG 2.2 SC 1.2.1 |
Evidence
- HTML Standard: The audio element — categories, content model, attributes, and HTMLAudioElement
- HTML Standard: Media elements — resource selection, state, playback, events, loading, and multiple tracks
- HTML Accessibility API Mappings 1.0: audio — computed role and platform mappings; Working Draft
- WCAG 2.2 SC 1.2.1 — prerecorded audio-only and video-only alternatives
- Web Platform Tests: the-audio-element and media-elements — test discovery entry points. Results for nine selected files appear in Implementation Evidence and are separate from full-directory coverage.
Implementation Evidence
Normative claims are tracked separately from browser, WPT, and Accessibility Tree observations. IMPL, WPT, and AAM have partial measurements from selected scope in Chrome 154 / Windows 11 Pro build 26200.
| Type | Observation scope | Conditions to record | Status |
|---|---|---|---|
| IMPL | MIME candidate selection for child source, networkState / readyState, metadata / data / canplay events, duration / currentTime, activation-triggered play() Promise / playing / pause, loading IDL support, and native controls |
2026-09-26 / Chrome UA 154.0.0.0 / Windows 11 Pro build 26200. The local audio-v1 mono PCM16 WAV (44.1 kHz, 3 s) skipped an unsupported MIME candidate and selected sample.wav from an HTTP 206 audio/wav Range response. Observed loadedmetadata → loadeddata → canplay, duration 3 s, networkState=1, readyState=4. At button click user activation was true; play() resolved and playing fired with volume=0 / muted=false; after about 500 ms currentTime=0.286 s and playback was active. With only an unsupported source, networkState=3, currentSrc empty, and error=null. |
Partial observation (Chrome 154 / one environment) |
| WPT | Selected WPTs for the the-audio-element constructor and loading behavior, plus shared media-elements initial states, src reflection, and metadata / canplay events |
2026-09-26 / Chrome UA 154.0.0.0 / Windows 11 Pro build 26200 / wpt.live. All 28/28 assertions passed across four audio-specific and five shared-media files: audio-loading-eager.html (1/1), audio_constructor.html (11/11), audio-loading-lazy-in-viewport.html (1/1), audio-loading-load-preload-metadata-deferred.html (1/1), networkState_initial.html (2/2), readyState_initial.html (2/2), src_reflects_attribute_not_source_elements.html (2/2), event_loadedmetadata_noautoplay.html (4/4), event_canplay_noautoplay.html (4/4). The GitHub WPT master listing has 20 and 71 direct HTML tests in those directories, respectively. Nested tests, remaining files, and other browsers were not run.The test version used was not recorded. The linked test may change, so this result cannot be repeated with certainty against the same version. |
Partial run (28/28 pass) |
| AAM | Chrome Accessibility Tree snapshot of an aria-labeled audio container description and native play button, seek slider, and additional media controls; the HTML-AAM computed role is kept as a specification mapping |
2026-09-26 / Chrome UA 154.0.0.0 / Windows 11 Pro build 26200. The snapshot showed Description “Atlas audio-v1 test tone”, button “再生”, slider “オーディオ再生バー”, and other controls. The HTML-AAM 1.0 Working Draft (2026-09-23) html-audio role mapping was reviewed separately. Windows platform APIs and assistive technology were not observed. |
Partial observation (Chrome AX tree) |
IMPL uses a local PCM WAV fixture, WPT covers the nine files linked in the table with 28/28 assertions passing, and AAM records a Chrome Accessibility Tree snapshot. Full WPT coverage, other browsers, Windows platform APIs, and assistive technology remain unverified.
Coverage / Open Issues
- Specification reviewedMeaning, categories, context, content models with and without
src, shared media attributes, and DOM interface - Specification reviewedSource-selection, network / ready states, playback promises, and event-model entry points
- Specification reviewedHTML-AAM Working Draft and applicability of WCAG 2.2 SC 1.2.1
- Partial observationA Chrome 154 fixture confirmed source selection, media states and events, user-activated playback, and timeline. Other browsers, codecs, and error types remain open.
- Partial observationNine selected
wpt.livefiles passed 28/28 assertions. The remaining files and nested tests in both directories were not run. - Partial / openNative controls were observed in Chrome's Accessibility Tree. Windows platform APIs, assistive technology, transcript announcements, CORS, multiple audio tracks, and other browsers were not tested.
These partial observations are limited to Chrome 154 / Windows 11 Pro build 26200. They do not claim playback verification across browsers or codecs, complete WPT coverage, platform accessibility API or assistive-technology behavior, or that all audio content meets accessibility requirements.
Related surface
For a beginner-friendly guide to audio examples, playback controls, source candidates, and transcripts, see audio in Yugien. Parent-specific source attributes and candidate selection are covered by the source element. For the shared media state and playback model plus a visual playback area, see the video element; see the track element for timed-text kinds, attributes, and WebVTT, and picture for image-resource selection.