JavaScript SpeechSynthesis API


As the online continues to be the medium for all customers, requirements our bodies have to proceed to supply new APIs to counterpoint 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 offered in all trendy browsers.

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

  • Create Spinning Rays with CSS3: Revisited
  • CSS vs. JS Animation: Which is Faster?

    How is it doable that JavaScript-based animation has secretly at all times been as quick — or quicker — than CSS transitions? And, how is it doable that Adobe and Google persistently launch media-rich cellular websites that rival the efficiency of native apps? This text serves as a point-by-point…


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles