3.6 C
New York
Thursday, January 22, 2026

JavaScript SpeechSynthesis API


As the net continues to be the medium for all customers, requirements our bodies must proceed to offer new APIs to complement consumer 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 consumer something you present as a SpeechSynthesisUtterance string. Assist for this API is obtainable in all fashionable 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!

  • Create Namespaced Classes with MooTools

    MooTools has all the time gotten a little bit of grief for not inherently utilizing and standardizing namespaced-based JavaScript courses just like the Dojo Toolkit does.  Many builders create their courses as globals which is usually frowned up.  I largely disagree with that stance, however every to their very own.  In any occasion…

  • 9 Mind-Blowing Canvas Demos

    The <canvas> ingredient has been a revelation for the visible specialists amongst our ranks.  Canvas offers the means for unimaginable and environment friendly animations with the added bonus of no Flash; these builders can flash their superior JavaScript abilities as an alternative.  Listed here are 9 unbelievable canvas demos that…

  • Detect Pseudo-Element Animation Support
  • MooTools: Set Style Per Media

    I would guess one of the crucial used MooTools strategies is the setStyle() methodology, which lets you set CSS fashion declarations for a component. One of many limitations of MooTools’ setStyle() methodology is that it units the particular fashion for all medias.


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles