Speech Support
==============

See AnnunciatorFactory, AnnunciatorTest.java for usage.

"LINE UNAVAILABLE: Format is ..."
---------------------------------

On a Linux computer that is also producing beeps and other sounds,
there were occasional error messages
"LINE UNAVAILABLE: Format is ..."

This is generated by the JavaStreamingAudioPlayer and JavaClipAudioPlayer of FreeTTS.
There is no Java Exception or other mechanism to detect this error deep inside the FreeTTS library.
All you get is the message on System.out.

A workaround was added to FreeTTSHacks to configure the FreeTTS audio player to keep trying
for some time.

If the audio device is permanently used by another program, there is of course no way to get access.
Under Linux, this command will display the ID of the process that is currently holding the audio
device, so you can then try to get rid of the offending program:
  /sbin/fuser /dev/dsp

FreeTTS Detail
--------------

Sources:
freetts-1.2.2-src.zip

Extracted from that into /lib and added to classpath:
cmu_time_awb.jar
cmu_us_kal.jar
cmudict04.jar
cmulex.jar
cmutimelex.jar
en_us.jar
freetts.jar
jsapi.jar


#
# Run the original tests
#
 cd lib
 unzip freetts-1.2.2-src.zip
 rm -rf META-INF

# ^^^ these steps will also allow you to source-level debug
# ^^^ the Annunciator code down into FreeTTS

 cd freetts-1.2.2/lib
 sh jsapi.sh
 cd ..
# Build.xml is broken. Change the "src" path to ".":
#     <property name="src_dir" value="." />
  vi build.xml
 ant
 java -jar bin/HelloWorld.jar
 java -jar bin/FreeTTSHelloWorld.jar
# Will complain about missing speech.properties. Copy to home dir...
 cp speech.properties ~
# .. then try the *Hello*jar again
 
 
#
# Jar file explosion
# 
Tests look like they only need these jars:
  freetts.jar and maybe jsapi.jar
  
But to function, FreeTTS looks for voices.txt
in the same directory that contained freetts.jar,
and then it opens all the other jar files
to locate the voices listed in voices.txt,
adds them to the classloader, and tries to
create them.

When using JSAPI, speech.properties is also required
in various places.

This runtime lookup of files, jars, and especially
the manipulation of the class loader clashes with
the Eclipse/equinox handling of the classpath.

Setting the System Property "freetts.voices"
and including the FreeTTS jars beforehand
in the classpath (or the Eclipse MANIFEST.MF)
seems to avoid the use of the voices.txt
as well as the runtime classpath gymnastics.