History

better support for voice feats

Alan W Black committed 9 years ago

Commit a7ec22a1 parent f15235c4 files · +76 −1Browse files

Unified · Split

4 files
  1. tools/Makefile +1 −1
  2. tools/VOICE_cg.c +3 −0
  3. tools/build_flite +6 −0
  4. tools/make_flite_feats +66 −0
tools/Makefile+1−1
@@ -49,7 +49,7 @@ SCRIPTS = build_flite setup_flite huff_table flite_test \ · 48 unmodified lines
4949 make_voice_list wfst2c build_lex clunit_prune \
5050 a2byte.pl a2short.pl a2int.pl flite_rename_voice \
5151 make_lang_list make_new_lang_lex flitechecks \
52− add_flite_feats run_flitecheck quantize_params
52+ add_flite_feats make_flite_feats run_flitecheck quantize_params
5353 SCM=make_lex.scm make_lts.scm make_cart.scm play_sync.scm \
5454 make_phoneset.scm make_vallist.scm make_clunits.scm \
5555 make_didb.scm make_didb2.scm make_f0lr.scm make_lts_wfst.scm \
tools/VOICE_cg.c+3−0
@@ -65,6 +65,9 @@ cst_voice *register___VOICENAME__(const char *voxdir) · 64 unmodified lines
6565 /* Things that weren't filled in already. */
6666 flite_feat_set_string(vox->features,"name","__VOICENAME__");
6767
68+ /* Voice specific features from ../etc/voice.feats */
69+#include "__VOICENAME___voice_feats.c"
70+
6871 /* Lexicon */
6972 lex = __FLITELEX___init();
7073 flite_feat_set(vox->features,"lexicon",lexicon_val(lex));
tools/build_flite+6−0
@@ -382,6 +382,12 @@ then · 381 unmodified lines
382382 "."
383383 "flite/")'
384384
385+ touch flite/${FV_VOICENAME}_voice_feats.c
386+ if [ -f etc/voice.feats ]
387+ then
388+ ${FLITEDIR}/tools/make_flite_feats etc/voice.feats >flite/${FV_VOICENAME}_voice_feats.c
389+ fi
390+
385391 if [ "$FV_LANG_TYPE" = "grapheme" ]
386392 then
387393 echo cg_convert: converting phoneset table
tools/make_flite_feats+66−0
@@ -0,0 +1,66 @@
1+#!/bin/sh
2+###########################################################################
3+## ##
4+## Language Technologies Institute ##
5+## Carnegie Mellon University ##
6+## Copyright (c) 2017 ##
7+## All Rights Reserved. ##
8+## ##
9+## Permission is hereby granted, free of charge, to use and distribute ##
10+## this software and its documentation without restriction, including ##
11+## without limitation the rights to use, copy, modify, merge, publish, ##
12+## distribute, sublicense, and/or sell copies of this work, and to ##
13+## permit persons to whom this work is furnished to do so, subject to ##
14+## the following conditions: ##
15+## 1. The code must retain the above copyright notice, this list of ##
16+## conditions and the following disclaimer. ##
17+## 2. Any modifications must be clearly marked as such. ##
18+## 3. Original authors' names are not deleted. ##
19+## 4. The authors' names are not used to endorse or promote products ##
20+## derived from this software without specific prior written ##
21+## permission. ##
22+## ##
23+## CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK ##
24+## DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ##
25+## ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT ##
26+## SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE ##
27+## FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ##
28+## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ##
29+## AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ##
30+## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ##
31+## THIS SOFTWARE. ##
32+## ##
33+###########################################################################
34+## ##
35+## Make feats for a voice so that they are in the linked in version ##
36+## ##
37+## $FLITEDIR/tools/make_flite_feats ../etc/voice.feats >VOICENAME_voice_feats.c ##
38+## ##
39+## ../etc/voice.feats should look something like ##
40+## ##
41+## age 42 ##
42+## gender male ##
43+## variant Scots ##
44+## ##
45+## If ./COPYING exists, the content is added as the feature copyright ##
46+## ##
47+###########################################################################
48+
49+export LANG=C
50+
51+awk '{if (NF > 1) print $0}' $1 | sed 's/"/\\"/g' |
52+awk '{printf("flite_feat_set_string(vox->features,\"%s\",\"",$1);
53+ for (i=2; i<NF; i++)
54+ printf("%s ",$i);
55+ printf("%s\");\n",$NF);}'
56+
57+if [ -f COPYING ]
58+then
59+ cat COPYING | sed 's/"/\\"/g' |
60+ awk 'BEGIN {printf("flite_feat_set_string(vox->features,\"copyright\",\" \\n\"\n");}
61+ { printf("\"%s\\n\"\n",$0); }
62+ END {printf(");\n");}'
63+fi
64+
65+exit
66+

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t