/usr/share/doc/HOWTO/ja-html/Text-To-Speech-mini-HOWTO-5.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>The Linux Text-To-Speech mini-HOWTO: $BIUO?(B</TITLE>
<LINK HREF="Text-To-Speech-mini-HOWTO-4.html" REL=previous>
<LINK HREF="Text-To-Speech-mini-HOWTO.html#toc5" REL=contents>
</HEAD>
<BODY>
$B<!$N%Z!<%8(B
<A HREF="Text-To-Speech-mini-HOWTO-4.html">$BA0$N%Z!<%8(B</A>
<A HREF="Text-To-Speech-mini-HOWTO.html#toc5">$BL\<!$X(B</A>
<HR>
<H2><A NAME="s5">5. $BIUO?(B</A></H2>
<H2><A NAME="ss5.1">5.1 A.1. /usr/lib/festival/lib/siteinit.scm $BMQ$N%F%s%W%l!<%H(B</A>
</H2>
<P>$B!J7Y9p!'(BScheme code $B$,B3$-$^$9!(M}2r$9$kI,MW$O$"$j$^$;$s!K(B
<PRE>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Site Initialisation file
;;; This is loaded near the end of init.scm,
;;; just before user initialisation file
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ==========================
;;; Style Management Functions
;;; ==========================
(defvar Styles '((default 140 22 1.0))
"Available voice styles")
(defvar style_default 'default
"Default voice style")
(defvar current_style 'none
"Current voice style")
(define (Style selected_style)
"(Style DEFINED_STYLE)
Sets the pitch, pitch variance, and speed of the current voice.
Type 'Styles' for a list of defined styles."
(let ((style (assoc selected_style Styles)))
(if (not style)
(set! style (assoc 'default Styles)))
(let ((model_mean (cadr (assoc 'model_f0_mean int_lr_params)))
(model_std (cadr (assoc 'model_f0_std int_lr_params)))
(new_mean (cadr style))
(new_std (cadr (cdr style)))
(new_stretch (cadr (cdr (cdr style)))))
(set! int_lr_params
(list
(list 'target_f0_mean new_mean)
(list 'target_f0_std new_std)
(list 'model_f0_mean model_mean)
(list 'model_f0_std model_std)))
(Parameter.set 'Duration_Stretch new_stretch)
(set! current_style (car style))
(list (car style) new_mean new_std new_stretch)
)
)
)
(define (NewStyle style_name mean std stretch)
"(NewStyle STYLE_NAME MEAN STD STRETCH)
Defines a new style; MEAN and STD refer to pitch mean and variance,
while STRETCH refers to inverse speed, 1.0 being the standard."
(set! Styles (cons (list style_name mean std stretch) Styles)))
(if (probe_file "/etc/festival.conf")
(load "/etc/festival.conf"))
</PRE>
<P>
<P>
<H2><A NAME="ss5.2">5.2 A.2. /etc/festival.conf $BMQ$N%F%s%W%l!<%H(B</A>
</H2>
<P>
<PRE>
;;; =================
;;; Style Definitions
;;; =================
(NewStyle 'male_frozen 80 10 1.5 )
(NewStyle 'male_slow 100 22 1.1 )
(NewStyle 'male_tenor 140 60 1.0 )
(NewStyle 'male_baritone 100 40 1.0 )
(NewStyle 'male_bass 70 25 1.0 )
(NewStyle 'male_relaxed 100 24 0.95)
(NewStyle 'male_newscaster 140 32 0.85)
(NewStyle 'male_hurried 117 22 0.80)
(NewStyle 'male_stressed 150 30 0.70)
(NewStyle 'male_fast 110 22 0.70)
(NewStyle 'male_faster 110 22 0.60)
(NewStyle 'male_panic 170 20 0.60)
(NewStyle 'male_fastest 110 22 0.55)
(NewStyle 'the_flash 110 22 0.45)
</PRE>
<P>
<P>
<P>
<H2><A NAME="ss5.3">5.3 A.3. $B%9%?%$%k$N%5%]!<%H$rDI2C$7$?%9%/%j%W%H(B</A>
</H2>
<P>$B$3$l$O(B festival $B$N%F%-%9%HFI$_>e$2$N%$%s%?!<%U%'%$%9$K@<<A$N(B
$B!V%9%?%$%k!W$N%5%]!<%H$rDI2C$9$k%9%/%j%W%H$G$9!#$[$+$N5!G=$rDI2C(B
$B$9$k$?$a$N%F%s%W%l!<%H$H$7$F$b;H$($^$9!#2?$+DI2C$7$?$i$<$R65$((B
$B$F$/$@$5$$!#(B
<P>
<P>$B%9%/%j%W%HL>$r(B saytext $B$H$7$F!"$4$/4JC1$K;H$$J}$r@bL@$7$F$*$-$^$7$g$&!#(B
<P>
<PRE>
saytext -h # $B!J$J$>$a$$$?!K%X%k%W%a%C%;!<%8$,$G$^$9(B
saytext [-s <$B%9%?%$%k(B>] [<$B%U%!%$%kL>(B>] # $B%U%!%$%k$b$7$/$OI8=`F~NO$rFI$_>e$2$^$9(B
</PRE>
<P>
<P><$B%9%?%$%k(B>$B$O!"B8:_$9$k$b$N$J$i2?$G$b$+$^$$$^$;$s!#(B<$B%U%!%$%kL>(B
>$B$,;XDj$5$l$J$$>l9g$O!"I8=`F~NO$,;H$o$l$^$9!#(B
<P>
<P>
<P>
<PRE>
$BNc(B saytext -s male_baritone myfile.txt
</PRE>
<P>
<P>$B$=$7$F$3$l$,%9%/%j%W%H$N%3!<%I$G$9!'(B
<P>
<PRE>
#!/usr/lib/festival/src/main/festival --script
;;; Here is a Festival script that adds voice "style"
;;; support to the text-to-speech command-line interface.
;;;
;;; Type "saytext -h" for help, including a list of available styles.
;;;
;;; User-defined "styles" can be declared in ~/.festivalrc like this:
;;;
;;; (NewStyle <name> <mean_pitch> <pitch_SD> <speed>)
;;; E.g: (NewStyle 'mystyle 100 23 0.9) ; Defines a baritone
;;;
;;; You can also set default styles:
;;;
;;; (set! style_default 'my_style)
;;;
;;; Styles may be selected within a script via:
;;;
;;; (Style <name>)
;;; E.g.: (Style 'my_style)
;;; ==============
;;; INITIALIZATION
;;; ==============
;;; Because this is a --script type file I have to explicitly
;;; load the initfiles: init.scm and user's .festivalrc
(load (string-append libdir "init.scm"))
(if (probe_file (format nil "%s/.festivalrc" (getenv "HOME")))
(load (format nil "%s/.festivalrc" (getenv "HOME"))))
;;; Clear rotten rendered speech from tmp
(system "/bin/rm -f /tmp/est_*")
;;; Process command-line arguments
(defvar TTS_Filename "-"
"This variable stores the name of the file to be read,
\"\" for stdin")
(while argv
(let ((option (car argv)))
(set! argv (cdr argv))
(cond
((eq? option '-s)
(if (length argv)
(let ((style (car argv)))
(if (not (assoc style Styles))
(format t "No style '%s, " style))
(Style style)
; (format t "Using style %s\n" current_style)
(set! argv (cdr argv))
)
(error "Syntax error in option: -s <style>" nil)))
((eq? option '-h)
(format t "Usage: saytext [-s <style> | -h]\n")
(format t "Available styles are:\n")
(format t " %l\n" Styles)
(quit))
(t
(set! TTS_Filename (string-append "" option))))))
(tts TTS_Filename nil)
</PRE>
<P>
<HR>
$B<!$N%Z!<%8(B
<A HREF="Text-To-Speech-mini-HOWTO-4.html">$BA0$N%Z!<%8(B</A>
<A HREF="Text-To-Speech-mini-HOWTO.html#toc5">$BL\<!$X(B</A>
</BODY>
</HTML>
|