Documente Academic
Documente Profesional
Documente Cultură
txt
Last updated: Friday 12th September 2008, 8:38, AHD
Refresh to get latest version
The following information has been adapted from:
"Simply Java Programming" by Deitel and Deitel,
ISBN 0-13-142648-6
Pages 819 - 833
The following text is for information only.
Students will NOT be tested on any of this material.
*************************************************************
*************************************************************
Installation instructions for Java Speech API version FreeTTS
*************************************************************
*************************************************************
--------------------------------------
Java Speech - How to making Java speak
--------------------------------------
---------------------------------------
Creating Speech from text using FreeTTS
---------------------------------------
Introduction
------------
FreeTTS is open source (free) software
written entirely in Java - and licensed for use
by the creators of Java - Sun Microsystems.
FreeTTS gives you the ablility to write Java
programs (applications or applets) which will allow
speech output generated from inputted text -
i.e. the text you input at the keyboard
will be spoken through your computer's speakers.
This type of Java application might be used,
for example, to automatically generate telephone messages,
or to put aural content onto web pages for the blind or seeing-impaired.
This type of program gives people who cannot speak,
the chance to conduct a telephone conversation...
There are lots of applications for a speech synthesizer like FreeTTS.
--------------------------
Java programs are portable
--------------------------
Java programs work on many different types of hardware and
mobile devices. Java applet programs are embedded in webpages -
thus can run on the Internet through all the latest browsers.
To install FreeTTS:
------------------
Go here:
http://sourceforge.net/project/showfiles.php?group_id=42080&package_id=34183
scroll down and
select the following file:
Release 1.1.2
This is not the latest release, but it is the release used
with these instructions, and with the example programs referred to.
Use FreeTTS Release 1.1.2.
Save the downloaded file freetts-1_1_2.tar.gz to your computer.
1. Unzip the file using WinZip
2. While in WinZip, select Yes to decompress the freetts-1_1_2.tar
file to a temporary directory.
3. Extract the content of the freetts-1_1_2.tar file to C:\
This will create a FreeTTS directory in the C:\ directory.
Accept the license Agreement
----------------------------
IMPORTANT:
To complete the installation you need to
click on the Start button on the Desktop, then Run, then
click on the Browse button and browse to
C:\FreeTTS\lib\jsapi.exe
and click the button to agree to the License Agreement.
OR
to do the same thing using a Command Prompt window:
Start button -> All Programs -> Accessories -> Command Prompt
At a command prompt, type:
cd C:\FreeTTS\lib
Then, type: jsapi.exe
This installs the Java Speech API after you
click the button to agree to the License Agreement.
Use notepad.exe:
Start button -> All Programs -> Accessories -> Notepad
to create a batch file (just a regular text file)
which you save as setclasspath.bat in
c:\Program Files\Java\jdk1.6.0_02\bin
setclasspath.bat contains the following set CLASSPATH line:
(IMPORTANT: the next line is all on one line - don't press the Enter key)
set CLASSPATH=C:\FreeTTS\lib\cmuawb.jar;C:\FreeTTS\lib\cmukal16.jar;C:\FreeTTS\l
ib\cmukal8.jar;C:\FreeTTS\lib\cmulex.jar;C:\FreeTTS\lib\cmutimelex.jar;C:\FreeTT
S\lib\demo.jar;C:\FreeTTS\lib\freetts.jar;C:\FreeTTS\lib\JSAPI.JAR;.
Copy and paste the above line into your setclasspath.bat file,
or better still, just download from:
http://www.annedawson.net/setclasspath.bat
Save this setclasspath.bat file in
c:\Program Files\Java\jdk1.6.0_02\bin
You create another batch file
which you can save as C:\go.bat
- which contains these two lines:
cd c:\Program Files\Java\jdk1.6.0_02\bin
dir
or just download from:
http://www.annedawson.net/go.bat
In a command prompt
Start -> All Programs -> Accessories -> Command Prompt
At the command prompt type:
cd \
go
You will see a file listing for folder:
c:\Program Files\Java\jdk1.6.0_02\bin
Now type:
setclasspath
you will see the SET classpath instuction.
You now need to compile each of the three java files listed above,
by proceeding as follows:
At the command prompt, type:
javac Speaker.java
after a short time the prompt reappears.
Now type:
javac Speaks.java
after a short time the prompt reappears.
Now type:
javac SpeakerHelper.java
after a short time the prompt reappears.
Copy and Paste any text into the running java program
-----------------------------------------------------
********************************************************************
********************************************************************
To run the Speaker program when everything is installed and compiled
********************************************************************
********************************************************************
Start -> All Programs -> Accessories -> Command Prompt
At the command prompt type:
cd \
go
setclasspath
java Speaker
********************************************************************
********************************************************************
********************************************************************
********************************************************************