Java InstantCode. Developing Applications using Java Speech API

 Download CD Content

The Java API provides the javax.speech, javax.speech.synthesis, javax.telephony, and javax.telephony.media packages to develop an interactive voice response system application, which helps end users to auto-reply to the calls received.

This chapter describes how to use the Java Speech API with Java Telephony API (JTAPI) to develop the Auto Answering Machine application. The Auto Answering Machine application uses a telephone line to reply to a call. The telephone line is connected to a modem. The application checks the status of a call and reads out a welcome message to answer the call.

Architecture of the Auto Answering Machine Application

The Auto Answering Machine application provides an interface that allows end users to select a modem from the list of providers installed on the computer. The modem is connected to a telephone line. The application establishes a connection with the modem and listens for a call.

The Auto Answering Machine application uses the following files:

Figure 8-1 shows the architecture of the Auto Answering Machine application:

Figure 8-1: Architecture of the Auto Answering Machine Application

The AutoAnswerGUI.java file provides the main user interface that contains the combo box to select the provider to establish a connection with the modem. The user interface also contains two buttons , Start Service and Exit.

The Select the Provider combo box allows end users to select the provider to establish a connection with the modem. Click the Start Service button to start the Auto Answering Machine application.

The AutoAnswerGUI.java file calls the AutoAnswerObserver.java file when a call is made and checks the status of the call. The AutoAnswerObserver.java file also reads out a welcome message if the status of the call is ACTIVE.

The AutoAnswerGUI.java class calls the AnswerText.java class to read out a welcome message to the caller.

Категории