JavaScript SpeechSynthesis API

Date:

Share post:

As the web continues to be the medium for all users, standards bodies need to continue to provide new APIs to enrich user experience and accessibility. One underused API for unsighted users is speechSynthesis, an API to programmatically direct the browser to audibly speak any arbitrary string.

The Code

You can direct the browser to utter speech with window.speechSynthesis and SpeechSynthesisUtterance:

window.speechSynthesis.speak(
    new SpeechSynthesisUtterance('Hey Jude!')
)

speechSynthesis.speak will robotically tell the user anything you provide as a SpeechSynthesisUtterance string. Support for this API is available in all modern browsers.

I wouldn’t consider speechSynthesis as a replacement for native accessibility tools, but this API could be used to improve what native tools provide!

Request Metrics real user monitoring
Request Metrics real user monitoring
Request Metrics real user monitoring
  • 5 Ways that CSS and JavaScript Interact That You May Not Know About
  • Responsive and Infinitely Scalable JS Animations

    Responsive and Infinitely Scalable JS Animations

    Back in late 2012 it was not easy to find open source projects using requestAnimationFrame() – this is the hook that allows Javascript code to synchronize with a web browser’s native paint loop. Animations using this method can run at 60 fps and deliver fantastic…

  • Create a Simple News Scroller Using MooTools, Part I:  The Basics
  • Adding Events to Adding Events in jQuery

Source link
spot_img

Related articles

New Tomiris tools and techniques: multiple reverse shells, Havoc, AdaptixC2

While tracking the activities of the Tomiris threat actor, we identified new malicious operations that began in early...

Cyber Monday wipes $150 off Apple AirPods Max at Amazon in limited-time deal

Grab Apple's high-end over-ear headphones for a discount price Updated: Nov 29, 2025 9:24...

8 Finance Event Activations that Spur Creativity and Innovation

In an industry driven by data, regulation, and risk mitigation, creativity might not be the first word that...