1 Why this criterion exists
When audio starts playing automatically on a web page, it can create a significant barrier for users who rely on assistive technology, particularly screen readers. Screen readers convert text to speech, and when background audio plays simultaneously, the two audio streams compete for the user's attention. This overlap can make the screen reader's output unintelligible, effectively silencing the user's primary means of accessing the content. The Web Content Accessibility Guidelines (WCAG) address this with Success Criterion 1.4.2 Audio Control, which falls under the Perceivable principle. This criterion exists to ensure that users can perceive all content without interference from unexpected audio.
The criterion requires that if any audio on a web page plays automatically for more than three seconds, the user must be able to pause, stop, or control the volume of that audio independently of the overall system volume. This three-second threshold is intentional: it allows brief sound effects or notifications that do not significantly disrupt the user experience, while preventing longer audio from hijacking the user's attention. By providing control, users can manage their own auditory environment, which is especially critical for those who depend on audio cues from their screen reader or other assistive technologies.
Ultimately, this criterion is about respecting user autonomy and ensuring equal access to information. Without it, users who cannot see the screen or who have difficulty processing multiple audio streams would be excluded from content that relies on audio. It is a foundational requirement for creating inclusive web experiences.
2 Who it protects
Success Criterion 1.4.2 primarily protects screen reader users, who navigate the web by listening to synthesized speech. When autoplay audio starts, it can mask the screen reader's output, forcing users to either wait for the audio to finish or attempt to find a way to stop it. For users who are blind or have low vision, this can be disorienting and time-consuming, as they may need to navigate through the page to locate a pause button, often without visual cues. Additionally, users with cognitive disabilities such as attention deficit hyperactivity disorder (ADHD) or autism may find overlapping audio streams overwhelming and difficult to process, leading to cognitive overload and frustration.
Users with hearing impairments also benefit from this criterion, though in a different way. While they may not hear the autoplay audio, they might rely on captions or transcripts for other media. If autoplay audio interferes with the ability to access those alternatives, it creates an unnecessary barrier. Moreover, individuals who use assistive listening devices or hearing aids may experience distortion or discomfort when unexpected audio plays, especially if they cannot easily adjust the volume. The criterion also supports users in noisy environments or those who simply prefer to browse without sound, ensuring that they are not forced to endure unwanted audio.
In essence, this criterion protects anyone who needs to control their auditory environment to effectively consume web content. It recognizes that audio is a powerful but potentially disruptive medium, and that user control is essential for accessibility.
3 How conformance is measured
Conformance to Success Criterion 1.4.2 is measured by checking whether any automatically playing audio on a page exceeds three seconds in duration and, if so, whether a mechanism exists to pause, stop, or adjust its volume independently of the system volume. The criterion applies to all audio that plays without user initiation, including background music, sound effects, and spoken content. It does not apply to audio that the user explicitly starts, such as by clicking a play button, because the user has already expressed intent to hear it. The three-second rule is a key threshold: if the audio stops within three seconds, it is considered compliant, as it is unlikely to significantly interfere with assistive technology.
To measure conformance, evaluators must first identify all instances of autoplay audio on a page. This can be done manually by loading the page and listening for any sound that begins without interaction. Automated tools like axe or WAVE can flag the presence of audio elements with the autoplay attribute, but they cannot determine the duration or whether controls are provided. Therefore, manual verification is essential. Once autoplay audio is detected, the evaluator must time its duration. If it plays longer than three seconds, they must then check for a control mechanism. The control must be able to pause or stop the audio, or adjust its volume separately from the system volume. The control should be easily discoverable and operable by keyboard and screen reader users.
It's important to note that the criterion does not require the control to be visible at all times; it can be revealed on hover or focus, as long as it is accessible. However, if the control is hidden, it must still be reachable and usable by keyboard and assistive technology. Conformance is binary: either the audio is controlled or it is not. Partial compliance, such as providing a control that only works with a mouse, does not meet the criterion.
4 Where teams usually slip
Teams often run into trouble with Success Criterion 1.4.2 when they implement autoplay audio without considering its impact on assistive technology. A common mistake is assuming that because a pause button exists, the criterion is satisfied, without ensuring that the button is keyboard accessible or properly labeled for screen readers. For example, a pause button that is an unlabeled icon or that cannot be reached via the Tab key will be useless to screen reader users, who may not even know it exists. Another frequent slip is providing a volume control that only adjusts the audio relative to the system volume, rather than independently. The criterion explicitly requires independent volume control, meaning the user should be able to change the audio's volume without affecting other sounds on their device.
Teams also sometimes overlook the three-second rule. They might include a short sound effect that lasts just over three seconds, thinking it's negligible, but for a screen reader user, even a few seconds of overlap can cause them to miss important content. Additionally, some developers use autoplay for background music that loops indefinitely, and while they may provide a pause button, they might not ensure that the button is visible or easily discoverable. If the button is hidden in a corner or requires scrolling to find, users may struggle to locate it, especially if they cannot see the screen. Another issue arises when audio is triggered by JavaScript after page load, which automated tools might not catch, leading teams to believe they are compliant when they are not.
Finally, teams may forget to test with actual screen readers. They might rely solely on automated checkers, which cannot evaluate the user experience of overlapping audio. This gap between automated and manual testing often results in overlooked violations that only become apparent when a screen reader user attempts to navigate the page.
5 Fixing it in your markup
To meet Success Criterion 1.4.2, the most straightforward fix is to avoid autoplay audio altogether. If audio is not essential to the content, consider removing it or requiring the user to initiate playback. When autoplay is necessary, ensure that any audio lasting more than three seconds can be paused, stopped, or have its volume adjusted independently. In your markup, this typically means adding controls to the audio element or providing a separate button that controls the audio via JavaScript. The HTML5 audio element has a controls attribute that provides a built-in user interface with play, pause, and volume controls. However, the default controls may not be sufficient if the audio is set to autoplay, because the user still needs a way to stop it quickly. You can use JavaScript to pause the audio after three seconds if no user interaction occurs, but that may not be ideal for longer content.
A better approach is to provide a clearly labeled button that toggles the audio on and off. This button should be a native HTML button element, which is keyboard focusable and announced by screen readers. Use aria-label or visible text to describe its purpose, such as "Pause background music" or "Stop audio." If you need independent volume control, you can include a range input with an accessible label, and use JavaScript to adjust the audio's volume property. Ensure that the volume control does not affect the system volume. For audio that is part of a media player, the player's controls should be accessible and include a volume slider that is separate from the system volume. Always test with a keyboard to ensure that all controls are reachable and operable.
If you must have autoplay audio, consider limiting it to three seconds or less. This could be a short chime or notification that does not interfere with screen reader output. However, even short sounds can be disruptive if they overlap with speech, so it's best to provide a way to disable all non-essential audio. You can also use the prefers-reduced-motion media query to detect if a user has requested reduced motion, but note that this does not directly apply to audio. Instead, consider respecting the user's autoplay preferences by not autoplaying at all.
6 Testing before you ship
Testing for Success Criterion 1.4.2 should be a combination of automated and manual checks. Start by running an automated accessibility tool like axe, WAVE, or Lighthouse on your page. These tools can flag audio elements with the autoplay attribute, but they cannot determine the duration or whether controls are present. Therefore, you must manually verify each flagged instance. Load the page in a browser and listen for any audio that starts automatically. Use a timer to measure how long it plays. If it exceeds three seconds, check for a control mechanism. The control must be operable by keyboard: use the Tab key to navigate to it and press Enter or Space to activate it. It should also be announced properly by a screen reader; test with at least one screen reader, such as NVDA, JAWS, or VoiceOver, to ensure that the control's label and role are conveyed correctly.
Next, verify that the volume control, if provided, adjusts the audio independently of the system volume. You can test this by changing the system volume and observing whether the audio's volume changes accordingly. It should not; the control should only affect the audio element. Also, check that the control is visible or becomes visible on focus. If it is hidden until hover, ensure that keyboard focus also reveals it. Additionally, test the page with JavaScript disabled to see if the audio still autoplays; if it does, you may need to provide a fallback. Finally, consider testing with users who rely on screen readers. Their feedback can reveal issues that automated tools and even expert manual testing might miss, such as the cognitive load of overlapping audio or the difficulty of locating controls.
Remember that conformance is not just about passing a checklist; it's about ensuring a usable experience. A page that technically provides a pause button but makes it hard to find or operate still fails the spirit of the criterion. Therefore, incorporate accessibility testing into your development workflow early and often, and prioritize fixes based on user impact.
7 Frequently asked questions
What if the audio is shorter than three seconds? The criterion only applies to audio that plays for more than three seconds. If your audio stops within three seconds, it is considered compliant, as it is unlikely to significantly interfere with assistive technology. However, be cautious: even short sounds can be disruptive if they overlap with critical screen reader output. It's best to avoid autoplay audio altogether unless it is essential and user-controlled.
Does the criterion apply to video with audio? Yes, if the video plays automatically and includes audio that lasts more than three seconds, the same rules apply. You must provide a mechanism to pause, stop, or control the volume of the audio. This could be through the video player's controls, as long as they are accessible. Note that if the video is muted by default, the criterion does not apply because there is no audio output. However, if the user unmutes it, they have initiated the audio, so the criterion is not triggered.
Can I use the muted attribute to avoid the criterion? Yes, if you set the audio or video to muted by default, no sound will play automatically, so the criterion does not apply. However, if the user unmutes it, they are initiating the audio, so it's their choice. Just ensure that the unmute control is accessible. But be aware that some users may not realize the media is muted and may miss important audio content. Providing captions and transcripts can help mitigate that.
What about background music that loops? If background music autoplays and loops for more than three seconds, you must provide a control to pause, stop, or adjust its volume independently. A simple mute button is not sufficient because it does not allow volume adjustment; however, a pause button that stops the audio is acceptable. Ensure the control is keyboard accessible and clearly labeled. Also, consider that looping audio can be particularly distracting, so it's best to avoid it unless the user explicitly opts in.
Is a volume slider in the browser's media controls sufficient? Browser media controls often adjust the system volume or the tab's volume, not the audio element independently. The criterion requires control that is independent of the system volume, so you should provide a dedicated volume control for the audio element itself. If the browser's controls only affect system volume, they do not meet the criterion. Always test to confirm.