1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6 * Copyright 2004 Sun Microsystems, Inc.
8 * See the file "license.terms" for information on usage and
9 * redistribution of this file, and for a DISCLAIMER OF ALL
16 <head><title>CMU ARCTIC to FreeTTS</title></head>
19 <table bgcolor="#FFCC66" width="100%">
21 <td align=center width="100%">
22 <h1>CMU ARCTIC To FreeTTS</h1>
28 <p>This page provides details on importing <a
29 href="http://festvox.org/cmu_arctic/">CMU ARCTIC</a> voices to
30 FreeTTS. It has been tested on the awb, bdl, jmk, and slt
31 ARCTIC 0.95 voices.</p>
33 <p>Note that this is very preliminary
34 documentation meant to help those who are chomping at the bit
35 to get CMU ARCTIC voices into FreeTTS. There is still some
36 work to do (e.g., the resulting voices do not sound exactly
37 like they do in Festival), but the work is ready for people to
41 <h3>Obtaining the CMU ARCTIC Voices</h3>
42 <p>Many many thanks to the folks behind the CMU ARCTIC
43 voices. They have given the world a great wealth of
46 <p>You can obtain a CMU ARCTIC voice from the
47 <a href="http://festvox.org/cmu_arctic/">CMU ARCTIC</a>
48 web site. We've succesfully imported the bdl, slt, jmk,
49 and awb voices (note: the awb voice requires you do a
50 little extra work - see the note at the end of this page).</p>
52 <p>As of the writing of this document (January 2005), we
53 have not attempted to create a CMU ARCTIC voice ourselves,
54 but expect the tools provided by FreeTTS will support
55 new CMU ARCTIC voices that you create.</p>
58 <h3>Preparing to Import a CMU ARCTIC Voice</h3>
59 <p>You need to have downloaded, built, and installed the
60 <a href="http://festvox.org/festival/index.html">Festival
61 Speech Synthesis System</a>.
63 <p>The script to import a CMU ARCTIC Voice is
64 tools/ArcticToFreeTTS/ArcticToFreeTTS.sh. It is designed to
65 be run from the voice directory that contains the CMU ARCTIC
66 data. Before running the script, you need to edit it to
67 ensure that the following variables are set specifically to
70 <li><code>JAVA_HOME</code> - points to your installation
71 of the Java platform.</li>
73 <li><code>ESTDIR</code> - points to the speech_tools
74 directory of the Festival installation.</li>
76 <li><code>FESTIVALDIR</code> - points to the festival
77 directory of the Festival installation.</li>
79 <li><code>FESTVOXDIR</code> - points to the festvox
80 directory of the FestVox installation.</li>
82 <li><code>FREETTSDIR</code> - points to the FreeTTS
83 directory of the FreeTTS installation.</li>
85 <p>At some point, we will probably make life a little
86 easier for you (or perhaps you'd like to make life easier for
87 us and submit your changes back to this open source effort),
88 but right now, please just edit the script.</p>
90 <h3>Importing a CMU ARCTIC Voice into FreeTTS</h3>
91 <p>The procedure for importing a CMU ARCTIC voice into FreeTTS
94 <li>Make sure you've edited the
95 tools/ArcticToFreeTTS/ArcticToFreeTTS.sh script as
98 <li>Download the voice you'd like to import, and unpack
99 it in a directory. For example:
101 <p><code>~/work/festival/custom_voices/cmu_us_slt_arctic</code>
104 <li>cd to the directory where you unpacked the voice.
105 The contents of this directory should look something like
109 AREADME emu festvox pm
110 COPYING etc lab pm_lab
112 bin festival mcep wav
116 <li>Run the ArcticToFreeTTS.sh script:
118 <p><code>~/work/SourceForge/FreeTTS/FreeTTS/tools/ArcticToFreeTTS/ArcticToFreeTTS.sh</code>
124 <p>The script will output a fair amount of information and
125 will take a fair amount of time to complete (about 1 hour on a
126 867MHz PowerBook G4 Mac OS X system). The script creates a
127 new voice directory under your FreeTTS installation. For
128 example, assume you imported the slt voice. The script will
129 create the following contents in the following directory:
132 com/sun/speech/freetts/en/us/cmu_us_slt_arctic/
134 ArcticVoice.java nums_cart.txt
135 ArcticVoiceDirectory.java part_of_speech.txt
136 cmu_us_slt_arctic.txt phoneset.txt
137 dur_stat.txt phrasing_cart.txt
138 durz_cart.txt prefix_fsm.txt
139 f0_lr_terms.txt suffix_fsm.txt
140 int_accent_cart.txt voice.Manifest
145 The script also compiles the voice for you and places the
146 resulting jar in the FreeTTS lib directory. For example,
147 lib/cmu_us_slt_arctic.jar. At this point, the voice is ready
148 to be used. You can test the voice as follows.
151 <li>Make sure the jar file is OK:
154 java -jar lib/cmu_us_slt_arctic.jar
156 VoiceDirectory 'com.sun.speech.freetts.en.us.cmu_us_slt_arctic.ArcticVoiceDirectory'
159 Description: CMU ARCTIC Cluster Unit Voice
174 <li>Test the voice using the freetts demo
175 application. Note that the CMU ARCTIC voices are very
176 large. As such, it may take several minutes before FreeTTS
177 has loaded the voice and made it ready for use.
180 java -mx512m -jar lib/freetts.jar -voice slt_arctic
187 <h3>Note on the AWB CMU ARCTIC Voice</h3>
189 <p>The AWB CMU ARCTIC voice uses a different unit selection
190 algorithm than the other CMU ARCTIC voices. That is, whereas
191 the other CMU ARCTIC voices select units based upon phone,
192 stress, onset, and coda features, the AWB CMU ARCTIC voice
193 selects units based solely on phone and stress features. As
194 such, the AWB CMU ARCTIC voice needs a little extra work to
195 import it to FreeTTS.</p>
197 <p>For one thing, the ArcticToFreeTTS tools expect the Scheme
198 for the ARCTIC voices to follow a particular pattern. In
199 particular, the etc/voice.defs file defines a FV_FULLVOICENAME
200 variable that is built up from the various attributes of the
201 voice. The ArcticToFreeTTS tools expect there to be a file in
202 the festvox subdirectory whose name is the value of
203 FV_FULLVOICENAME with a ".scm" extension. In this file, it is
204 expected that there will be a definition of the form
205 "voice_$FV_FULLVOICENAME" where $FV_FULLVOICENAME expands to
206 the value of FV_FULLVOICENAME.
208 <p>All the ARCTIC voices except the AWB voice follow this
209 pattern. The AWB voice, however, uses "f0clunits" as an
210 attribute for some of the types in etc/voice.defs. <b>Before
211 importing</b>, you'll need to change all the occurrences of
212 "f0clunits" in the cmu_us_awb_arctic etc/voice.defs file to
213 "clunits" in order to match the pattern expected by the
214 ArcticToFreeTTS tools:
222 FV_VOICENAME=$FV_INST"_"$FV_LANG"_"$FV_NAME
223 FV_FULLVOICENAME=$FV_VOICENAME"_"$FV_TYPE
225 FV_VOICENAME=$FV_INST"_"$FV_LANG"_"$FV_NAME
226 FV_FULLVOICENAME=$FV_VOICENAME"_"$FV_F0TYPE
232 <p>If you do not make this change, you'll see the following
233 error when you run the ArcticToFreeTTS tools. The error will
234 occur very early in the ArcticToFreeTTS output, so if you are
235 not watching, you'll miss it. You'll know you didn't make
236 this change, though, because you'll have empty dur_stat.txt
237 and durz_cart.txt files in the
238 com/sun/speech/freetts/en/us/cmu_us_awb_arctic/ directory that
239 was created when you ran the ArcticToFreeTTS tools:
243 SIOD ERROR: unbound variable : voice_cmu_us_awb_arctic_f0clunits
247 <p>Once you've made this change, you can run the
248 ArcticToFreeTTS tools to get the AWB data in FreeTTS form.
250 <p>Once you've imported the AWB data, you now need to modify
251 the ArcticVoice.java file that was created in
252 com/sun/speech/freetts/en/us/cmu_us_awb_arctic/ when you
253 imported the voice. The modification tells the voice to use a
254 different unit selector, and requires that you override the
255 "getUnitSelector" method. First, you'll need to add some
256 extra imports to the file:
260 import java.io.IOException;
261 import com.sun.speech.freetts.Item;
262 import com.sun.speech.freetts.UtteranceProcessor;
263 import com.sun.speech.freetts.clunits.ClusterUnitSelector;
267 <p>Next, you'll need to override the getUnitSelector method:
271 public UtteranceProcessor getUnitSelector() throws IOException {
272 return new AwbUnitSelector(getDatabase());
277 <p>Finally, you'll need
278 to define the new unit selector. This can be added as a
279 class at the end of the ArcticVoice.java file:
282 class AwbUnitSelector extends ClusterUnitSelector {
283 private static final String VOWELS = "aeiou";
285 public AwbUnitSelector(URL url) throws IOException {
290 * Sets the cluster unit name given the segment.
292 * @param seg the segment item that gets the name
294 protected void setUnitName(Item seg) {
297 String segName = seg.getFeatures().getString("name");
299 /* If we have a vowel, then the unit name is the segment name
300 * plus a 0 or 1, depending upon the stress of the parent.
301 * Otherwise, the unit name is the segment name plus "coda"
302 * or "onset" based upon the seg_onsetcoda feature processor.
304 if (VOWELS.indexOf(segName.charAt(0)) >= 0) {
305 cname = segName + seg.findFeature("R:SylStructure.parent.stress");
309 seg.getFeatures().setString("clunit_name", cname);
315 <p>Once you've made these changes to the ArcticVoice.java
316 file, you can rebuild the voice as follows:
318 <p><code>ant -Darctic_voice=cmu_us_awb_arctic -find build.xml</code>
321 <p>Good luck, and have fun.</p>
324 <p>See the <a href="../../license.terms">license terms</a>
325 and <a href="../../acknowledgments.txt">acknowledgments</a>.
327 Copyright 2004 Sun Microsystems, Inc. All Rights
328 Reserved. Use is subject to license terms.</p>