1#!/bin/sh
2
3#wtow cards_distributed  cards distributed
4#wtow trick_move_in_pile trick move in pile
5#wtow card_played        card played
6
7ROOT=/usr/share/mbrola   # Where are the needed files?
8VOICE=$ROOT/de3/de3             # Path to the mbrola-voice
9SEX=m                           # m/f Which sex has your voice?
10
11# word to wav converter
12# 1. argument: sex
13# 2. argument: filename
14# + arguements: text
15function wtow {
16file=$1
17shift
18#echo $@
19echo $@ \
20| sed 's/@/ �t /g' \
21| $ROOT/pipefilt \
22| $ROOT/preproc $ROOT/Rules.lst $ROOT/Hadifix.abk \
23| $ROOT/txt2pho -$SEX -p $ROOT/data/ \
24| $ROOT/mbrola $VOICE - -.au \
25| sox -t au - $file.wav
26#aplay -q -t au -"
27} # function wtow
28
29
30# create english texts
31function create_sounds_en
32{
33  wtow re_won            re has won
34  wtow contra_won        contra has win
35  wtow soloplayer_won    the soloplayer has won
36  wtow soloplayer_lost   the soloplayer has lost
37  wtow no_winner         nobody has won
38
39  wtow reservation       reservation
40  wtow no_reservation    no reservation
41
42  wtow poverty           poverty
43  wtow poverty_denied    no
44  wtow poverty_accepted  poverty accepted
45  wtow swines            swines
46  wtow hyperswines       hyperswines
47
48  wtow re             re
49  wtow contra         Kontra
50  wtow no_120         no 120
51  wtow no_90          no 90
52  wtow no_60          no 60
53  wtow no_30          no 30
54  wtow no_0           blank
55  wtow no_120_reply   sure 120
56  wtow no_90_reply    sure 90
57  wtow no_60_reply    sure 60
58  wtow no_30_reply    sure 30
59  wtow no_0_reply     sure tricks
60
61  wtow thrown_nines             too many nines
62  wtow thrown_kings             too many kings
63  wtow thrown_nines_and_kings   too many nines and kings
64  wtow fox_highest_trump        fox is highest trump
65  wtow poverty                  poverty
66  wtow genscher                 genscher
67  wtow marriage                 marriage
68  wtow marriage_solo            marriage solo
69  wtow marriage_silent          silent marriage
70  wtow solo_jack                jacksolo
71  wtow solo_queen               queen solo
72  wtow solo_king                king solo
73  wtow solo_queen-jack          jack-queen-solo
74  wtow solo_king-jack           jack-king-solo
75  wtow solo_king-queen          queen-king-solo
76  wtow solo_koehler             Khler
77  wtow solo_club                club solo
78  wtow solo_spade               spade solo
79  wtow solo_heart               heart solo
80  wtow solo_diamond             diamond solo
81  wtow solo_meatless            meatless
82
83  wtow first_foreign            first foreign
84  wtow first_trump              first trump
85  wtow first_color              first color
86  wtow first_club               first club
87  wtow first_spade              first spade
88  wtow first_heart              first heart
89
90} # function create_sounds_en
91
92# create german texts
93function create_sounds_de
94{
95  wtow re_won            Re hat gewonnen
96  wtow contra_won        Kontra hat gewonnen
97  wtow soloplayer_won    Der Solospieler hat gewonnen
98  wtow soloplayer_lost   Der Solospieler hat verloren
99  wtow no_winner         keiner hat gewonnen
100
101  wtow reservation       Vorbehalt
102  wtow no_reservation    gesund
103
104  wtow poverty           Armut
105  wtow poverty_denied    Nein
106  wtow poverty_accepted  Armut angenommen
107  wtow swines            Schweine
108  wtow hyperswines       Hyperschweine
109
110  wtow re             re
111  wtow contra         kontra
112  wtow no_120         keine 120
113  wtow no_90          keine 90
114  wtow no_60          keine 60
115  wtow no_30          keine 30
116  wtow no_0           schwarz
117  wtow no_120_reply   doch 120
118  wtow no_90_reply    doch 90
119  wtow no_60_reply    doch 60
120  wtow no_30_reply    doch 30
121  wtow no_0_reply     doch Stiche
122
123  wtow thrown_nines             zu viele Neuner
124  wtow thrown_kings             zu viele Knige
125  wtow thrown_nines_and_kings   zu viele Neuner und Knige
126  wtow fox_highest_trump        Fuchs hchster Trumpf
127  wtow poverty                  Armut
128  wtow genscher                 Genscher
129  wtow marriage                 Hochzeit
130  wtow marriage_solo            Hochzeitssolo
131  wtow marriage_silent          stille Hochzeit
132  wtow solo_jack                Bubensolo
133  wtow solo_queen               Damensolo
134  wtow solo_king                Knigensolo
135  wtow solo_queen-jack          Buben-Damen-Solo
136  wtow solo_king-jack           Buben-K�nigen-Solo
137  wtow solo_king-queen          Damen-K�nigen-Solo
138  wtow solo_koehler             Khler
139  wtow solo_club                Kreuz-Solo
140  wtow solo_spade               Pik-Solo
141  wtow solo_heart               Herz-Solo
142  wtow solo_diamond             Karo-Solo
143  wtow solo_meatless            Fleischlos
144
145  wtow first_foreign            erster fremde
146  wtow first_trump              erster Trumpf
147  wtow first_color              erster Farb
148  wtow first_club               erster Kreuz
149  wtow first_spade              erster Pik
150  wtow first_heart              erster Herz
151
152} # function create_sounds_de
153
154# create old german texts
155function create_sounds_de_alt
156{
157  dir=$1
158  echo $dir
159  wtow re_won            Re hat gewonnen
160  wtow contra_won        Kontra hat gewonnen
161  wtow soloplayer_won    Der Solospieler hat gewonnen
162  wtow soloplayer_lost   Der Solospieler hat verloren
163  wtow no_winner         keiner hat gewonnen
164
165  wtow reservation       Vorbehalt
166  wtow no_reservation    gesund
167
168  wtow poverty           Armut
169  wtow poverty_denied    Nein
170  wtow poverty_accepted  Armut angenommen
171  wtow swines            Schweine
172  wtow hyperswines       Hyperschweine
173
174  wtow re             re
175  wtow contra         kontra
176  wtow no_120         keine 120
177  wtow no_90          keine 90
178  wtow no_60          keine 60
179  wtow no_30          keine 30
180  wtow no_0           schwarz
181  wtow no_120_reply   doch 120
182  wtow no_90_reply    doch 90
183  wtow no_60_reply    doch 60
184  wtow no_30_reply    doch 30
185  wtow no_0_reply     doch Stiche
186
187  wtow thrown_nines             zu viele Neuner
188  wtow thrown_kings             zu viele Knige
189  wtow thrown_nines_and_kings   zu viele Neuner und Knige
190  wtow fox_highest_trump        Fuchs hchster Trumpf
191  wtow poverty                  Armut
192  wtow genscher                 Genscher
193  wtow marriage                 Hochzeit
194  wtow marriage_solo            Hochzeitssolo
195  wtow marriage_silent          stille Hochzeit
196  wtow solo_jack                Untersolo
197  wtow solo_queen               Obersolo
198  wtow solo_king                Knigensolo
199  wtow solo_queen-jack          Unter-Ober-Solo
200  wtow solo_king-jack           Unter-K�nigen-Solo
201  wtow solo_king-queen          Ober-K�nigen-Solo
202  wtow solo_koehler             Khler
203  wtow solo_club                Eichel-Solo
204  wtow solo_spade               Gras-Solo
205  wtow solo_heart               Herz-Solo
206  wtow solo_diamond             Schellen-Solo
207  wtow solo_meatless            Fleischlos
208
209  wtow first_foreign            erster fremde
210  wtow first_trump              erster Trumpf
211  wtow first_color              erster Farb
212  wtow first_club               erster Eichel
213  wtow first_spade              erster Gras
214  wtow first_heart              erster Herz
215
216} # function create_sounds_de_alt
217
218echo "create german sounds"
219mkdir -p de/
220pushd .
221cd de/
222for v in de1 de2 de3 de5 de8; do
223  echo "  voice $v"
224  VOICE=/usr/share/mbrola/$v/$v
225  mkdir -p male/mbrola.$v
226  cd male/mbrola.$v
227  SEX=m
228  create_sounds_de
229  cd - >/dev/null
230  mkdir -p female/mbrola.$v
231  cd female/mbrola.$v
232  SEX=f
233  create_sounds_de
234  cd - >/dev/null
235done
236cp -r male/mbrola.de2 male/mbrola
237cp -r female/mbrola.de3 female/mbrola
238mkdir -p general/
239cp male/contra_won.wav male/no_winner.wav  male/re_won.wav general/
240popd >/dev/null
241
242echo "create old german sounds"
243mkdir -p de-alt/
244pushd .
245cd de-alt/
246for v in de1 de2 de3 de5 de8; do
247  echo "  voice $v"
248  VOICE=/usr/share/mbrola/$v/$v
249  mkdir -p male/mbrola.$v
250  cd male/mbrola.$v
251  SEX=m
252  create_sounds_de_alt
253  cd - >/dev/null
254  mkdir -p female/mbrola.$v
255  cd female/mbrola.$v
256  SEX=f
257  create_sounds_de_alt
258  cd - >/dev/null
259done
260cp -r male/mbrola.de2 male/mbrola
261cp -r female/mbrola.de3 female/mbrola
262mkdir -p general/
263cp male/contra_won.wav male/no_winner.wav  male/re_won.wav general/
264popd >/dev/null
265
266
267echo "create english sounds"
268mkdir -p en/
269pushd .
270cd en/
271for v in us1 us2 us3; do
272  echo "  voice $v"
273  VOICE=/usr/share/mbrola/$v/$v
274  mkdir -p male/mbrola.$v
275  cd male/mbrola.$v
276  SEX=m
277  create_sounds_en
278  cd - >/dev/null
279  mkdir -p female/mbrola.$v
280  cd female/mbrola.$v
281  SEX=f
282  create_sounds_en
283  cd - >/dev/null
284done
285cp -r male/mbrola.us3 male/mbrola
286cp -r female/mbrola.us3 female/mbrola
287mkdir -p general/
288cp male/mbrola/contra_won.wav \
289   male/mbrola/no_winner.wav \
290   male/mbrola/re_won.wav \
291   general/
292popd >/dev/null
293