Perceivable · 1.4 Distinguishable

Audio Control WCAG 1.4.2 · Level A

If audio plays automatically for more than 3 seconds, there must be a way to pause or stop it, or to set its volume separately from the system volume. Because such audio can block use of the whole page, every part of the page must meet this, not only content relied on for conformance.

Level
A
Since
WCAG 2.0
Principle
Perceivable
Guideline
1.4 Distinguishable

Live demo

Stop the music that starts by itself

The same task, done two ways: switch between the version that passes and the one that fails, or put them side by side. Everything in the box is live, so try it with a keyboard, a pointer or a screen reader.

Press Allow sound in this demo, or watch the meter. In each version, look for a way to stop the music.

Live example

Passes

Sea View Hotel

Rooms with a balcony over the bay, from $140 a night.

Breakfast on the terrace is included in every stay.

Check availability

What happened

    Why it passes

    The music starts by itself, but a Pause music button and a volume slider come first on the page, so a screen reader user can silence it at once and hear their screen reader again.

    Why it fails

    The music starts by itself and keeps playing with no way to stop it. A screen reader user cannot hear their screen reader over it, and the only fix is to turn down the whole device's volume.

    Examples

    Code that fails, and the fix

    Five examples, each one running: the usual ways this criterion fails, and code that passes. Listen to them, measure them, or copy the code.

    01What changes − autoplay + controls

    Fails

    Background music with no controls

    Live preview

    HTML
    <h1>Sea View Hotel</h1><audio src="/media/lobby-music.mp3" autoplay loop></audio>

    If the browser allows autoplay, the music starts on load and loops with no controls, so it plays for more than 3 seconds and only the system volume can silence it.

    Passes

    Music that plays only when asked

    Live preview

    HTML
    <h1>Sea View Hotel</h1><audio src="/media/lobby-music.mp3" controls loop></audio>

    Nothing plays until the person presses play, and the built-in controls can pause the music and set its volume (technique G171).

    02What changes + muted + controls

    Fails

    Video ad that autoplays with sound

    Live preview

    HTML
    <aside aria-label="Advertisement">  <video src="/ads/summer-sale.mp4" autoplay loop playsinline></video></aside>

    If the browser lets it start with sound, the soundtrack loops with no control to pause or mute it. 1.4.2 applies to the whole page, including ads.

    Passes

    Video that starts muted

    Live preview

    HTML
    <aside aria-label="Advertisement">  <video src="/ads/summer-sale.mp4" autoplay muted loop playsinline controls></video></aside>

    The video starts without sound, so no audio plays automatically, and the controls let people turn the sound on if they want it.

    Passes

    Mute button at the top of the page

    Live preview

    JavaScript
    // <button id="music-toggle" type="button" aria-pressed="false">Mute music</button>const music = document.getElementById("lobby-music");const toggle = document.getElementById("music-toggle");toggle.addEventListener("click", () => {  music.muted = !music.muted;  toggle.setAttribute("aria-pressed", String(music.muted));});

    A toggle placed first on the page mutes the autoplaying music, and aria-pressed tells screen readers whether mute is on (technique G170).

    Why it matters

    Who it helps

    Screen reader users may be unable to hear their screen reader over autoplaying sound, and people with attention or cognitive disabilities can be distracted by it.

    W3C: Understanding 1.4.2
    • Level A

      Level A is the minimum: failing it can shut some people out completely.

    • In WCAG versions

      Part of WCAG 2.0 since December 2008, and of every version after it.

      No WCAG 1.0 checkpoint maps to it.

    • Where it is required

      Required where the law names WCAG 2.0 or later at this level: the United States, Canada, the European Union, the United Kingdom, France, Germany, Italy, Spain, the Netherlands, Ireland, Norway, Switzerland, India, Japan, Australia, New Zealand and Israel.

    How to test

    Checking it

    A few concrete steps. Automated tools find some failures; most need a person.

    1. Load the page and note any audio, including video soundtracks, that starts by itself and plays for more than 3 seconds.
    2. Confirm an easy-to-find control can pause or stop that audio, or lower its volume separately from the system volume.

    Common failures

    Where it breaks

    • Background music or a video with sound starts on page load with no pause, stop or mute control.
    • An autoplaying video ad with sound can only be quieted with the device's system volume.