Updates to our Text to Speech support in PDF viewer

Some time ago we introduced text to speech functionality to the JPedal example viewer. This used the FreeTTS library and its default voices with the option of allowing you to add your own voices should you require. Recently with our code base tidying we have decided it’s time to change the text to speech functionality so you can create your own version using any library you wish. This has been achieved by having an interface that you can implement and pass into the PdfDecoder to allow the viewer to plug into your own text to speech.

This text to speech interface contains definitions for the various methods your speech code will require to work with the JPedal library. Below is the interface complete with comments to give further details as to the methods’ uses.


In order to use your text to speech functionality you will need to add your implementation to the viewer. This can be done by calling

PdfDecoder.addExternalHandler(SpeechClass, Options.SpeechEngine);

after the viewer has been created.

For those of you that are currently using the text to speech functionality and wish to use the FreeTTS libraries you will find an implementation of Speech using FreeTTS below.

With these changes you can have greater control over the text to speech functionality allowing you to easily use any library and set of voices you wish. You can even restrict access to a given amount of voices by not returning the values of voices you do not wish used.

If you’re a first-time reader, or simply want to be notified when we post new articles and updates, you can keep up to date by social media (Twitter, Facebook and Google+) or the Blog RSS.

Related Posts:

The following two tabs change content below.
Kieran France is a programmer for IDRSolutions. He enjoys tinkering with most things including gadgets, code and electronics. He often has no idea what to write in his blog posts but tries his hardest to make them interesting and entertaining, he also makes no excuses for his odd sense of humor.
KieranF

About Kieran France

Kieran France is a programmer for IDRSolutions. He enjoys tinkering with most things including gadgets, code and electronics. He often has no idea what to write in his blog posts but tries his hardest to make them interesting and entertaining, he also makes no excuses for his odd sense of humor.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>