Wednesday, July 29, 2026
HomeProgrammingJavaScript SpeechSynthesis API

JavaScript SpeechSynthesis API


As the net continues to be the medium for all customers, requirements our bodies have to proceed to offer new APIs to complement person expertise and accessibility. One underused API for unsighted customers is speechSynthesis, an API to programmatically direct the browser to audibly communicate any arbitrary string.

The Code

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

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

speechSynthesis.communicate will robotically inform the person something you present as a SpeechSynthesisUtterance string. Help for this API is out there in all trendy browsers.

I would not contemplate speechSynthesis as a alternative for native accessibility instruments, however this API might be used to enhance what native instruments present!

  • 7 Essential JavaScript Functions

    I keep in mind the early days of JavaScript the place you wanted a easy operate for nearly the whole lot as a result of the browser distributors applied options in a different way, and never simply edge options, primary options, like addEventListener and attachEvent.  Instances have modified however there are nonetheless a couple of capabilities every developer ought to…

  • How I Stopped WordPress Comment Spam

    I really like nearly each a part of being a tech blogger:  studying, preaching, bantering, researching.  The one half about running a blog that I completely detest:  coping with SPAM feedback.  For the previous two years, my weblog has registered 8,000+ SPAM feedback per day.  PER DAY.  Bloating my database…

  • Build a Slick and Simple MooTools Accordion

    Final week I coated a clean, refined MooTools impact known as Kwicks. One other nice MooTools creation is the Accordion, which acts like…anticipate it…an accordion! Now I’ve by no means been an enormous Bizarre Al fan so that is as near enjoying an accordion as…

  • Create a Sexy Persistent Header with Opacity Using MooTools or jQuery

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments