Re-enable freetts
authorKeith Packard <keithp@keithp.com>
Tue, 27 Jul 2010 00:04:04 +0000 (17:04 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 27 Jul 2010 00:04:04 +0000 (17:04 -0700)
ao-tools/altosui/AltosVoice.java
ao-tools/altosui/Makefile
ao-tools/altosui/Manifest.txt

index 0c34795c55083981df54cf56f9ff6dcdf74e6c8a..e4ea99a2220d80a8abbe3a83a602486a7a45f236 100644 (file)
 
 package altosui;
 
-/*import com.sun.speech.freetts.Voice;
+import com.sun.speech.freetts.Voice;
 import com.sun.speech.freetts.VoiceManager;
-import com.sun.speech.freetts.audio.JavaClipAudioPlayer; */
+import com.sun.speech.freetts.audio.JavaClipAudioPlayer;
 import java.util.concurrent.LinkedBlockingQueue;
 
 public class AltosVoice implements Runnable {
-/*
        VoiceManager                    voice_manager;
        Voice                           voice;
-*/
        LinkedBlockingQueue<String>     phrases;
        Thread                          thread;
 
@@ -36,29 +34,29 @@ public class AltosVoice implements Runnable {
                try {
                        for (;;) {
                                String s = phrases.take();
-/*                             voice.speak(s); */
+                               voice.speak(s);
                        }
                } catch (InterruptedException e) {
                }
        }
        public void speak(String s) {
                try {
-/*                     if (voice != null) */
+                       if (voice != null)
                                phrases.put(s);
                } catch (InterruptedException e) {
                }
        }
 
        public AltosVoice () {
-/*             voice_manager = VoiceManager.getInstance();
+               voice_manager = VoiceManager.getInstance();
                voice = voice_manager.getVoice(voice_name);
-               if (voice != null)  */ {
-/*                     voice.allocate(); */
+               if (voice != null) {
+                       voice.allocate();
                        phrases = new LinkedBlockingQueue<String> ();
                        thread = new Thread(this);
                        thread.start();
                        speak("Rocket Flight Monitor Ready");
-               } /* else {
+               } else {
                        System.out.printf("Voice manager failed to open %s\n", voice_name);
                        Voice[] voices = voice_manager.getVoices();
                        System.out.printf("Available voices:\n");
@@ -66,6 +64,6 @@ public class AltosVoice implements Runnable {
                                System.out.println("    " + voices[i].getName()
                                                   + " (" + voices[i].getDomain() + " domain)");
                        }
-                       } */
+               }
        }
 }
index 1c49ba1161d5b05c422cd6a47ae1bb81a7e0cc6e..4068eebe7d61fbe42079d3e15d2e539f5b5c25d0 100644 (file)
@@ -1,6 +1,6 @@
 .SUFFIXES: .java .class
 
-CLASSPATH=..:../libaltos:/usr/share/java/*:/home/keithp/src/freetts/freetts-1.2.2
+CLASSPATH=..:../libaltos:/usr/share/java/*:/Users/keithp/freetts-1.2.2/lib/*
 CLASSFILES=\
        AltosConvert.class \
        AltosFile.class \
index 0305fcfbe4ed73b4c2415f25cfeb5e3e8bf833d1..251ce2a014363294990050744e2f61c607b202e8 100644 (file)
@@ -1 +1,2 @@
 Main-Class: altosui.AltosUI
+Class-Path: freetts.jar