Blog · 11 min read
Avoid WCAG Failures: Accessible Text-to-Speech for Developers

Yes, text-to-speech is an accessibility feature, but it works best as an augmentation to semantic, WCAG-compliant markup, not a replacement for it. Before adding any speech synthesis, verify your HTML and ARIA are sound, then choose between native browser synthesis, cloud TTS, or pre-recorded audio based on W3C’s G79 technique and the Web Speech API.
TL;DR:
Native browser synthesis costs nothing, but voice lists may remain empty until
onvoiceschangedfires, and Safari and Chrome behave differently.Choose cloud synthesis when pronunciation control justifies its latency, ongoing fees, and third party data sharing; reserve prerecorded audio for short, critical passages.
Automated scans catch naming and ARIA errors but cannot assess pronunciation or timing; manual testing with VoiceOver, NVDA, and JAWS checks actual announcements.
For multilingual pages, assign accurate
langattributes to each language segment and test every declared language because voice coverage and pronunciation vary by device.Keep player controls keyboard operable, use visible labels, preserve natural focus order, and save speech rate and voice preferences between sessions.
Table of Contents
-
Implementation options: native, cloud, and pre-recorded audio
-
Reading complex content: formulas, code, and technical notation
What text-to-speech accessibility actually means
Text-to-speech converts written content into spoken audio on demand. It differs from a screen reader, which is a full assistive technology that announces page structure, navigation landmarks, form states, and interactive roles, not just the words on the page. TTS accessibility features, like a “listen to this article” button, give users an audio option without replacing that deeper navigational layer.
Several groups benefit from on-page TTS:
-
People with low vision who want audio without running a full screen reader.
-
Readers with dyslexia or other cognitive disabilities who process spoken language more easily than dense text.
-
People driving, cooking, or multitasking who want content read aloud situationally.
For short, high-stakes content such as legal disclaimers or safety instructions, a pre-recorded audio file or a dedicated player is often more reliable than real-time synthesis, since pronunciation accuracy matters more than flexibility.
Implementation options: native, cloud, and pre-recorded audio
Three main approaches cover most use cases, each with different tradeoffs for quality, cost, and control.
-
Web Speech API (SpeechSynthesis): Built into modern browsers at no cost, but voice availability varies by platform and some browsers only populate the voice list after the
onvoiceschangedevent fires, according to MDN’s SpeechSynthesis documentation. -
Cloud TTS services: Deliver higher-quality, more natural voices and better pronunciation control, but introduce latency, ongoing cost, and privacy considerations since text gets sent to a third-party server.
-
Pre-recorded audio: The most predictable option for short, critical passages. W3C’s G79 technique recommends a dedicated audio file as a reliable fallback when real-time synthesis risks mispronunciation or inconsistency.
A practical pattern many teams land on: use native Web Speech API synthesis as the default for general content, reserve cloud TTS for cases needing higher fidelity, and fall back to pre-recorded audio for small amounts of critical or sensitive text. Combining these approaches lets you balance cost against reliability instead of committing to one method everywhere.
Developer checklist and code-level tips for accessible TTS
Semantic markup comes first. An accessible name should describe the element’s purpose, and extra context belongs in aria-describedby, not in the name itself, per ARIA authoring practices.
-
Confirm
window.speechSynthesisexists before building any TTS feature. -
Populate the voice list only after
onvoiceschangedfires, since some browsers return an empty array before that event. -
Build each
SpeechSynthesisUtterancewith an explicitlang,rate, andpitchrather than relying on defaults. -
Manage the utterance queue deliberately so overlapping requests do not talk over each other.
-
Pre-create any
aria-liveregion in the DOM at page load, setaria-atomic="true", and avoid injecting that container dynamically, per WAI’s ARIA19 technique. -
Make player controls keyboard operable with visible labels for play, pause, rewind, and repeat, and preserve the page’s natural focus order.
-
Persist the user’s speech rate and voice preference across sessions.
-
For ambiguous or critical terms, follow WCAG 3.1.6 with screen-reader-only phonetic hints, inline microcopy, or dedicated audio.
-
Before adopting cloud TTS, review what text gets transmitted, where it is processed, and whether consent is needed for any personal information in that text.
Pro Tip: Test your voice list logic in Chrome and Safari separately: Chrome often returns voices only after onvoiceschanged, while Safari may populate them immediately, and code written for one will silently fail on the other.
Testing and validating TTS for users and compliance
Automated scans catch missing accessible names, ARIA misuse, and structural issues quickly, but they cannot judge whether a voice mispronounces a term or whether an announcement fires at the right moment. Scheduled scans paired with dated records give you a paper trail for compliance even though automation alone cannot certify full conformance.
Manual testing with real assistive technology fills that gap:
-
Test with VoiceOver, NVDA, and JAWS to confirm voice availability, correct
onvoiceschangedbehavior, and sensible announcement order. -
Check focus behavior when the player starts, pauses, or finishes reading.
-
Confirm all player controls are reachable and operable by keyboard alone.
-
Run test cases across short labels, long-form articles, pronunciation-sensitive strings, and dynamically updated content.
Keep screenshots, console logs, and dated scan reports as your compliance record. A structured testing workflow makes this documentation far easier to maintain over time.
Where TTS cannot substitute for accessible markup
TTS is complementary, not corrective. It does not satisfy requirements for semantic structure, alt text, captions, or keyboard operability, and a page that fails those fundamentals is not fixed by adding a “listen” button.

The Department of Justice’s 2024 rule points state and local government web content and mobile apps to WCAG conformance as the technical standard under Title II of the ADA. That guidance treats WCAG as the baseline, with TTS sitting on top of it, never in place of it. When your organization faces compliance obligations, document your remediation work and consult legal or compliance counsel for your specific situation; our WCAG 2.2 AA guidance covers the technical criteria in more depth.
Language and dialect support implications for accessibility
Voice availability varies enormously by language and dialect, and that variance directly affects who your TTS feature actually serves. A site built for a primarily English-speaking audience might assume broad voice coverage, but users browsing in regional dialects or less common languages often get a generic or mismatched voice, or none at all, depending on their device and browser.
This matters for pronunciation accuracy specifically. A voice trained for one dialect may misread place names, proper nouns, or loanwords common in another, undermining the exact pronunciation guidance WCAG 3.1.6 asks you to provide. If your content serves multiple language communities, test your TTS implementation separately for each lang attribute you declare, since a correct lang tag is what tells both screen readers and synthesis engines which pronunciation rules to apply.
Where cloud TTS is in play, check which languages and dialects the provider actually supports before committing, since coverage differs by vendor and tier. For content that mixes languages within a single page, wrap each language segment in its own element with the correct lang attribute, otherwise the synthesis engine will apply one language’s rules across content it was never meant for. This is a smaller detail than voice selection, but it is often the difference between an accessible experience and a confusing one for multilingual readers.
Reading complex content: formulas, code, and technical notation
Mathematical formulas and code snippets expose the limits of general-purpose TTS quickly. A synthesis engine reading raw LaTeX or a block of JavaScript aloud, character by character, produces noise rather than meaning. Symbols, indentation, and nesting carry structural information that a flat text-to-speech pass simply cannot convey.
For code, the more reliable approach pairs semantic markup with contextual labeling rather than relying on synthesis to interpret syntax. Wrapping code blocks in proper <code> and <pre> elements at least signals to assistive technology that the content is distinct from prose, and keeping variable names and comments in plain, pronounceable language reduces ambiguity when they are read aloud.
For mathematical content, dedicated markup such as MathML gives assistive technology a structured way to interpret and announce expressions correctly, something plain TTS over rendered text or images cannot do. Where that is not feasible, a plain-language description of the formula’s meaning, placed near the formula, serves a similar role to the pre-recorded audio fallback W3C recommends in G79 for small amounts of critical content.
In practice, the safest rule is to treat highly technical content as a case for human-reviewed alternatives rather than default synthesis. A short, accurate text description or a pre-recorded explanation will serve readers better than a voice engine guessing its way through notation it was never designed to parse.

Making TTS work across devices and platforms
Voice availability, default rate, and even keyboard shortcuts for TTS controls differ across operating systems and browsers, so an implementation tested only on one platform will likely behave inconsistently elsewhere. Desktop Chrome, mobile Safari, and Android browsers each expose the Web Speech API slightly differently, and some mobile browsers limit background audio playback in ways that can interrupt a reading session mid-article.
Responsive design principles apply to audio controls just as much as to layout. Player buttons need to remain large enough to tap accurately on a touchscreen, keyboard-operable on desktop, and positioned so they do not get clipped by mobile viewports or overlap with sticky navigation elements.
Where a native TTS feature is inconsistent across platforms, a dedicated third-party TTS tool embedded in your page or documents can offer a more uniform experience; a document-focused TTS add-on is one example of this pattern applied to documents and PDFs specifically. Whichever route you choose, test on real devices rather than browser emulators alone, since voice loading behavior and audio permissions often differ from what desktop testing suggests.
Author perspective: our view on responsible TTS rollout
We see teams reach for TTS before fixing semantic gaps, and that order should flip. Get your markup right, test it with real assistive technology, then layer on speech synthesis as a genuine enhancement rather than a quick-fix substitute.
— The AccessWiser Team
How we help you ship accessible TTS with confidence
We scan your site against WCAG 2.2 AA success criteria, with Section 508 and EN 301 549 mappings, and tie every finding to the specific element and criterion it affects, so you know exactly where your semantic foundation needs work before adding speech features. Each finding comes with plain-language guidance for fixing it directly in your code, and scheduled re-checks catch regressions over time, giving you dated scan records you can point to for documentation.
We offer a visitor-facing widget that adds reading aids and on-page text-to-speech alongside contrast, theme, and text-size controls, giving your visitors a ready-made audio option while your underlying markup does the real accessibility work. If you want to see where your site stands, current pricing details are available on our pricing page.
FAQ
Is text to speech an accessibility feature?
Yes, TTS is considered an accessibility feature, but it supplements rather than replaces core requirements like semantic markup, alt text, and keyboard accessibility. Department of Justice guidance points to WCAG conformance as the technical standard that TTS sits on top of, not a substitute for it.
How do disabled people use text to speech?
People with low vision, dyslexia, and other reading disabilities use TTS to have written content read aloud instead of or alongside visual reading. Screen reader users rely on a more comprehensive assistive technology that announces structure and navigation, while standalone TTS buttons serve people who want audio without that full toolset.
Does Windows 11 have built-in text to speech?
Windows includes built-in narration and speech features as part of its accessibility settings, separate from any browser-level Web Speech API support a website might implement. Developers building on-page TTS should still test with the Web Speech API directly rather than assuming OS-level tools cover their site’s content.
What are the speech accessibility features on my phone?
Mobile operating systems typically include screen reading and spoken-content features as part of their native accessibility settings, independent of whatever TTS a specific website or app builds in. For web content specifically, a site’s own TTS implementation using the Web Speech API behaves differently across mobile browsers, so testing on real devices matters more than relying on OS defaults alone.
Can automated accessibility scans detect TTS problems?
Automated scans reliably catch missing accessible names and ARIA misuse that affect TTS and screen readers alike, but they cannot judge voice pronunciation or announcement timing. Manual testing with tools like VoiceOver, NVDA, and JAWS remains necessary to validate the actual listening experience.
Sources
Recommended
-
Developers: Map Accessibility Testing API Results to WCAG 2.2 and ACT
-
Three Part WCAG 2.2 Testing Workflow for Developers to Run in CI/CD
-
Fix WordPress Accessibility Errors: Code Level WCAG 2.2 AA Workflow
-
Two Pass NVDA and Firefox Screen Reader Testing Developers Can Run
Articles on this blog are general information about web accessibility, not legal advice. Laws change and their application depends on your specific situation — for decisions with legal consequences, consult a qualified legal professional.
Articles on this blog are general information about web accessibility, not legal advice. Laws change and their application depends on your specific situation — for decisions with legal consequences, consult a qualified legal professional.