diff options
author | Keith Packard <keithp@keithp.com> | 2010-07-26 17:04:04 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-07-26 17:04:04 -0700 |
commit | e9153c4f2c71ed965822fcfe5112d2bc38506baf (patch) | |
tree | 1718f9f49b4e9de09acf2a4dc3fbf9affe8d19eb | |
parent | 17188f36fe18c23bc2eb877ac9a01b7693f4b863 (diff) |
Re-enable freetts
-rw-r--r-- | ao-tools/altosui/AltosVoice.java | 20 | ||||
-rw-r--r-- | ao-tools/altosui/Makefile | 2 | ||||
-rw-r--r-- | ao-tools/altosui/Manifest.txt | 1 |
3 files changed, 11 insertions, 12 deletions
diff --git a/ao-tools/altosui/AltosVoice.java b/ao-tools/altosui/AltosVoice.java index 0c34795c..e4ea99a2 100644 --- a/ao-tools/altosui/AltosVoice.java +++ b/ao-tools/altosui/AltosVoice.java @@ -17,16 +17,14 @@ 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)"); } - } */ + } } } diff --git a/ao-tools/altosui/Makefile b/ao-tools/altosui/Makefile index 1c49ba11..4068eebe 100644 --- a/ao-tools/altosui/Makefile +++ b/ao-tools/altosui/Makefile @@ -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 \ diff --git a/ao-tools/altosui/Manifest.txt b/ao-tools/altosui/Manifest.txt index 0305fcfb..251ce2a0 100644 --- a/ao-tools/altosui/Manifest.txt +++ b/ao-tools/altosui/Manifest.txt @@ -1 +1,2 @@ Main-Class: altosui.AltosUI +Class-Path: freetts.jar |