Adding Text-to-Speech to Your Document Viewer
Text-to-speech (also known as speech synthesis) is the artificial production of human speech. It is most commonly used to allow people with visual impairments or reading disabilities to listen to written words. Thanks to the Speech Synthesis API, which is natively supported in modern browsers, text-to-speech functionality can easily be integrated into a web application. In this post, I will outline how to add it to the PrizmDoc Viewer with a few simple steps.
1. Add a Listen Menu
Add the code below to viewer-assets/templates/viewerTemplate.html to add a "Listen" menu to the viewer containing a play, pause, and stop button. You can add this code after the div containing "data-pcc-nav-tab=”esign”" to show the "Listen" tab to the right of the existing "E-Sign" tab.