The Java API provides the javax.speech.synthesis and javax.speech packages to develop an application that converts the text in an online Java tutorial to speech.
This chapter describes how to develop the Online Java Tutorial application, which converts the text in the Java tutorial to speech by using the javax.speech and javax.speech.synthesis packages. This application provides a user interface using, which end users can select, any topic of the tutorial to view the text in that topic. The application then reads out the selected topic.
The Online Java Tutorial application allows end users to listen to the text in the tutorial. The application provides two panes, left and right. The left pane shows the various topics of the tutorial. The right pane shows the text contained in the selected topic. The application converts the text corresponding to the selected topic in the tutorial to speech.
The Online Java Tutorial application uses the following files:
Tutorial.java: Allows end users to select a topic from the tutorial to view the corresponding text.
SpeakText.java: Converts the text in the Java tutorial to speech.
Figure 7-1 shows the architecture of the Online Java Tutorial application:
The Tutorial.java file provides the main user interface, which is divided into two panes, left and right.
The Tutorial.java file calls the SpeakText.java file to convert the text corresponding to the selected topic to speech.