?? arctictofreetts.sh
字號:
#!/bin/bash# Portions Copyright 2004 Sun Microsystems, Inc.# Portions Copyright 1999-2003 Language Technologies Institute,# Carnegie Mellon University.# All Rights Reserved. Use is subject to license terms.## See the file "license.terms" for information on usage and# redistribution of this file, and for a DISCLAIMER OF ALL# WARRANTIES.# Shell script to do a lot of the work to import a cluster# unit selection voice into FreeTTS. This is still a work# in progress.# You should override these environment variables to match# your environment.#export JAVA_HOME=/usrexport ESTDIR=/Users/wwalker/work/festival/speech_toolsexport FESTIVALDIR=/Users/wwalker/work/festival/festivalexport FESTVOXDIR=/Users/wwalker/work/festival/festvoxexport FREETTSDIR=/Users/wwalker/work/SourceForge/FreeTTS/FreeTTSexport HELPERDIR=$FREETTSDIR/tools/ArcticToFreeTTSexport JAVAHEAP=-mx512m# Compile the helping Java classes#(cd $HELPERDIR; mkdir -p classes; cd src; javac -d ../classes *.java)# Get FV_VOICENAME and FV_FULLVOICENAME#. ./etc/voice.defsecho Importing $FV_VOICENAMEexport VOICEDIR=$FREETTSDIR/com/sun/speech/freetts/en/us/$FV_VOICENAMEmkdir -p FreeTTSmkdir -p $VOICEDIR# Import F0_MEAN (for setPitch) and F0_RANGE (for setPitchRange)## [[[WDW FIXME: Currently unused.]]]#$FESTIVALDIR/bin/festival -b \ festvox/$FV_FULLVOICENAME.scm \ $HELPERDIR/scheme/dump_f0_terms.scm \ "(begin (voice_${FV_FULLVOICENAME}) (dump_f0_terms))" > \ /tmp/foo.shchmod +x /tmp/foo.sh. /tmp/foo.sh######################################################################### ## Create voice-specific files that are not part of the big database. ## ## [[[WDW FIXME: Currently copies some files from FreeTTS instead of ## generating them directly from the voice data itself.]]] ## #########################################################################echo Creating $VOICEDIR/dur_stat.txt$FESTIVALDIR/bin/festival -b \ festvox/$FV_FULLVOICENAME.scm \ $HELPERDIR/scheme/dump_dur_stat.scm \ "(begin (voice_${FV_FULLVOICENAME}) (dump_dur_stat))" > \ $VOICEDIR/dur_stat.txtecho Creating $VOICEDIR/durz_cart.txt$FESTIVALDIR/bin/festival -b \ festvox/$FV_FULLVOICENAME.scm \ $HELPERDIR/scheme/dump_durz_cart.scm \ "(begin (voice_${FV_FULLVOICENAME}) (dump_durz_cart))" > \ $VOICEDIR/durz_cart.txtecho Creating $VOICEDIR/f0_lr_terms.txtcp $FREETTSDIR/com/sun/speech/freetts/en/us/f0_lr_terms.txt $VOICEDIRecho Creating $VOICEDIR/int_accent_cart.txtcp $FREETTSDIR/com/sun/speech/freetts/en/us/int_accent_cart.txt $VOICEDIRecho Creating $VOICEDIR/int_tone_cart.txtcp $FREETTSDIR/com/sun/speech/freetts/en/us/int_tone_cart.txt $VOICEDIRecho Creating $VOICEDIR/nums_cart.txtcp $FREETTSDIR/com/sun/speech/freetts/en/us/nums_cart.txt $VOICEDIRecho Creating $VOICEDIR/part_of_speech.txt$FESTIVALDIR/bin/festival -b \ festvox/$FV_FULLVOICENAME.scm \ $HELPERDIR/scheme/dump_pos.scm \ "(begin (voice_${FV_FULLVOICENAME}) (dump_pos))" > \ $VOICEDIR/part_of_speech.txtecho Creating $VOICEDIR/phoneset.txt$FESTIVALDIR/bin/festival -b \ festvox/$FV_FULLVOICENAME.scm \ $HELPERDIR/scheme/dump_phoneset.scm \ "(begin (voice_${FV_FULLVOICENAME}) (dump_phoneset))" > \ $VOICEDIR/phoneset.txtecho Creating $VOICEDIR/phrasing_cart.txtcp $FREETTSDIR/com/sun/speech/freetts/en/us/phrasing_cart.txt $VOICEDIRecho Creating $VOICEDIR/prefix_fsm.txtcp $FREETTSDIR/com/sun/speech/freetts/en/us/prefix_fsm.txt $VOICEDIRecho Creating $VOICEDIR/suffix_fsm.txtcp $FREETTSDIR/com/sun/speech/freetts/en/us/suffix_fsm.txt $VOICEDIR######################################################################### ## Create voice-specific files that are part of the big database. ## These will ultimately be concatenated together to make the big txt ## file for the voice data. ## #########################################################################echo Creating lpc filesmkdir -p lpcbin/make_lpc wav/*.wavecho Creating lpc/lpc.paramsfor file in lpc/*.lpc; do $ESTDIR/bin/ch_track -otype est_ascii $filedone | sed '1,/EST_Header_End/d' |awk 'BEGIN {min=0; max=0;} { for (i=4; i<=NF; i++) { if ($i < min) min = $i; if ($i > max) max = $i; } } END { printf("LPC_MIN=%f\n",min); printf("LPC_MAX=%f\n",max); printf("LPC_RANGE=%f\n",max-min); }' > lpc/lpc.paramsecho Creating mcep/mcep.params and converting mcep files to textfor file in mcep/*.mcep; do echo $file MCEP $ESTDIR/bin/ch_track -otype est_ascii $file > $file.txt cat $file.txtdone | sed '1,/EST_Header_End/d' |awk 'BEGIN {min=0; max=0;} { for (i=4; i<=NF; i++) { if ($i < min) min = $i; if ($i > max) max = $i; } } END { printf("MCEP_MIN=%f\n",min); printf("MCEP_MAX=%f\n",max); printf("MCEP_RANGE=%f\n",max-min); }' > mcep/mcep.paramsecho "Creating short term signal (STS) files in sts/*.sts"mkdir -p stsjava -cp $HELPERDIR/classes FindSTS \ `find wav -type f | cut -f2 -d/ | cut -f1 -d.`echo Creating FreeTTS/misc.txt$FESTIVALDIR/bin/festival -b \ festvox/$FV_FULLVOICENAME.scm \ $HELPERDIR/scheme/dump_misc.scm \ "(begin (voice_${FV_FULLVOICENAME}) (dump_misc))" > \ FreeTTS/misc.txt# UnitDatabase outputs its own info...java $JAVAHEAP -cp $HELPERDIR/classes UnitDatabase \ festival/clunits/${FV_VOICENAME}.catalogue \ `find wav -type f | cut -f2 -d/ | cut -f1 -d.`echo Creating FreeTTS/trees.txt$FESTIVALDIR/bin/festival -b \ festvox/$FV_FULLVOICENAME.scm \ $HELPERDIR/scheme/dump_trees.scm \ "(begin (voice_${FV_FULLVOICENAME}) (dump_trees))" > \ FreeTTS/trees.txtecho Creating FreeTTS/weights.txt$FESTIVALDIR/bin/festival -b \ festvox/$FV_FULLVOICENAME.scm \ $HELPERDIR/scheme/dump_join_weights.scm \ "(begin (voice_${FV_FULLVOICENAME}) (dump_join_weights))" > \ FreeTTS/weights.txt######################################################################### ## Now create the big database file and also set up the *.java files ## for this voice. ## #########################################################################echo Creating $VOICEDIR/$FV_VOICENAME.txt(cd FreeTTS; cat misc.txt unit_catalog.txt trees.txt unit_index.txt sts.txt mcep.txt weights.txt > $VOICEDIR/$FV_VOICENAME.txt)echo Creating $VOICEDIR/ArcticVoiceDirectory.javacat $HELPERDIR/ArcticVoiceDirectory.java.template | \ sed "s/%FV_VOICENAME%/$FV_VOICENAME/g" | \ sed "s/%FV_NAME%/$FV_NAME/g" | \ sed "s/%FV_INST%/$FV_INST/g" > \ $VOICEDIR/ArcticVoiceDirectory.javaecho Creating $VOICEDIR/ArcticVoice.javacat $HELPERDIR/ArcticVoice.java.template | \ sed "s/%FV_VOICENAME%/$FV_VOICENAME/g" | \ sed "s/%FV_NAME%/$FV_NAME/g" | \ sed "s/%FV_INST%/$FV_INST/g" > \ $VOICEDIR/ArcticVoice.javaecho Creating $VOICEDIR/voice.Manifestcat $HELPERDIR/voice.Manifest.template | \ sed "s/%FV_VOICENAME%/$FV_VOICENAME/g" | \ sed "s/%FV_NAME%/$FV_NAME/g" | \ sed "s/%FV_INST%/$FV_INST/g" > \ $VOICEDIR/voice.Manifestecho Compiling $FV_VOICENAME(cd $FREETTSDIR; ant -Darctic_voice=$FV_VOICENAME)echo Done.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -