Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 215 lines (197 sloc) 5.897 kb
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
1 =============================================
fc81b8e @zaf README updates.
authored
2 Google TTS script for Asterisk
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
3 =============================================
4
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
5 This script makes use of Google's translate text to speech service
6 in order to redner text to speech and play it back to the user.
fc81b8e @zaf README updates.
authored
7 It supports a variety of different languages.
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
8
9 ------------
10 Requirements
11 ------------
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
12 Perl The Perl Programming Language
13 perl-libwww The World-Wide Web library for Perl
6132224 @zaf Added speed factor option.
authored
14 sox Sound eXchange, sound processing program
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
15 mpg123 MPEG Audio Player and decoder
ff99052 @zaf README updates.
authored
16 Internet access in order to contact google and get the voice data.
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
17
18 ------------
19 Installation
20 ------------
21 To install copy googletts.agi to your agi-bin directory.
22 Usually this is /var/lib/asterisk/agi-bin/
23 To make sure check your /etc/asterisk/asterisk.conf file
24
25 -----
26 Usage
27 -----
222252b @zaf Added user defined speed factor and sox version auto-detection
authored
28 agi(googletts.agi,"text",[language],[intkey],[speed]): This will invoke the Google TTS
29 engine, render the text string to speech and play it back to the user.
30 If 'intkey' is set the script will wait for user input. Any given interrupt keys will
31 cause the playback to immediately terminate and the dialplan to proceed to the
32 matching extension (this is mainly for use in IVR, see README for examples).
33 If 'speed' is set the speech rate is altered by that factor (defaults to 1.2).
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
34
35 The script contacts google's TTS service in order to get the voice data
ff99052 @zaf README updates.
authored
36 which then stores in a local cache (by default /tmp/) for future use.
37 Parameters like default language, enabling or disabling caching and cache dir
38 can be set up by editing the script.
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
39
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
40 --------
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
41 Examples
42 --------
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
43 sample dialplan code for your extensions.conf
44
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
45 ;GoogleTTS Demo
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
46 ;PLayback messages to user
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
47
48 exten => 1234,1,Answer()
28b8b66 @zaf Added language option validity, improved cli app.
authored
49 ;;Play mesage in English:
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
50 exten => 1234,n,agi(googletts.agi,"This is a simple google text to speech test in english.",en)
28b8b66 @zaf Added language option validity, improved cli app.
authored
51 ;;Play message in Spanish
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
52 exten => 1234,n,agi(googletts.agi,"Esta es una simple prueba en español.",es)
28b8b66 @zaf Added language option validity, improved cli app.
authored
53 ;;Play message in Greek
7c607a3 @zaf Fixed typo in README
authored
54 exten => 1234,n,agi(googletts.agi,"Αυτό είναι ένα απλό τέστ στα ελληνικά.",el)
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
55
56 ;A simple dynamic IVR using GoogleTTS
57
58 [my_ivr]
59 exten => s,1,Answer()
60 exten => s,n,Set(TIMEOUT(digit)=5)
61 exten => s,n,agi(googletts.agi,"Welcome to my small interactive voice response menu.",en)
28b8b66 @zaf Added language option validity, improved cli app.
authored
62 ;;Wait for digit:
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
63 exten => s,n(start),agi(googletts.agi,"Please dial a digit.",en,any)
f35a6a0 @zaf Removed the waiting for user input after the end of playback.
authored
64 exten => s,n,WaitExten()
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
65
28b8b66 @zaf Added language option validity, improved cli app.
authored
66 ;;PLayback the name of the digit and wait for another one:
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
67 exten => _X,1,agi(googletts.agi,"You just pressed ${EXTEN}. Try another one please.",en,any)
f35a6a0 @zaf Removed the waiting for user input after the end of playback.
authored
68 exten => _X,n,WaitExten()
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
69
70 exten => i,1,agi(googletts.agi,"Invalid extension.",en)
71 exten => i,n,goto(s,start)
7ae7113 @zaf Fixed Digit timeout for compatibility with 1.4.
authored
72
73 exten => t,1,agi(googletts.agi,"Request timed out.",en)
74 exten => t,n,goto(s,start)
75
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
76 exten => h,1,Hangup()
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
77
78 -------------------
79 Supported Languages
80 -------------------
28b8b66 @zaf Added language option validity, improved cli app.
authored
81 Afrikaans: af
82 Albanian: sq
83 Amharic: am
84 Arabic: ar
85 Armenian: hy
86 Azerbaijani: az
87 Basque: eu
88 Belarusian: be
89 Bengali: bn
90 Bihari: bh
91 Bosnian: bs
92 Breton: br
93 Bulgarian: bg
94 Cambodian: km
95 Catalan: ca
96 Chinese Simplified: zh-CN
97 Chinese Traditional:zh-TW
98 Corsican: co
99 Croatian: hr
100 Czech: cs
101 Danish: da
102 Dutch: nl
103 English: en
104 Esperanto: eo
105 Estonian: et
106 Faroese: fo
107 Filipino: tl
108 Finnish: fi
109 French: fr
110 Frisian: fy
111 Galician: gl
112 Georgian: ka
113 German: de
114 Greek: el
115 Guarani: gn
116 Gujarati: gu
117 Hacker: xx-hacker
118 Hausa: ha
119 Hebrew: iw
120 Hindi: hi
121 Hungarian: hu
122 Icelandic: is
123 Indonesian: id
124 Interlingua: ia
125 Irish: ga
126 Italian: it
127 Japanese: ja
128 Javanese: jw
129 Kannada: kn
130 Kazakh: kk
131 Kinyarwanda: rw
132 Kirundi: rn
133 Klingon: xx-klingon
134 Korean: ko
135 Kurdish: ku
136 Kyrgyz: ky
137 Laothian: lo
138 Latin: la
139 Latvian: lv
140 Lingala: ln
141 Lithuanian: lt
142 Macedonian: mk
143 Malagasy: mg
144 Malay: ms
145 Malayalam: ml
146 Maltese: mt
147 Maori: mi
148 Marathi: mr
149 Moldavian: mo
150 Mongolian: mn
151 Montenegrin: sr-ME
152 Nepali: ne
153 Norwegian: no
154 Norwegian Nynorsk: nn
155 Occitan: oc
156 Oriya: or
157 Oromo: om
158 Pashto: ps
159 Persian: fa
160 Pirate: xx-pirate
161 Polish: pl
4241671 @zaf Cleaned up supported language list.
authored
162 Portuguese: pt
28b8b66 @zaf Added language option validity, improved cli app.
authored
163 Portuguese Brazil: pt-BR
164 Portuguese Portugal:pt-PT
165 Punjabi: pa
166 Quechua: qu
167 Romanian: ro
168 Romansh: rm
169 Russian: ru
170 Scots Gaelic: gd
171 Serbian: sr
172 Serbo-Croatian: sh
173 Sesotho: st
174 Shona: sn
175 Sindhi: sd
176 Sinhalese: si
177 Slovak: sk
178 Slovenian: sl
179 Somali: so
180 Spanish: es
181 Sundanese: su
182 Swahili: sw
183 Swedish: sv
184 Tajik: tg
185 Tamil: ta
186 Tatar: tt
187 Telugu: te
188 Thai: th
189 Tigrinya: ti
190 Tonga: to
191 Turkish: tr
192 Turkmen: tk
193 Twi: tw
194 Uighur: ug
195 Ukrainian: uk
196 Urdu: ur
197 Uzbek: uz
198 Vietnamese: vi
199 Welsh: cy
200 Xhosa: xh
201 Yiddish: yi
202 Yoruba: yo
203 Zulu: zu
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
204
205 -------
206 License
207 -------
4149dc4 @zaf When 'intkey' is set the script waits for user input.
authored
208 The GoogleTTS script for asterisk is distributed under the GNU General Public
b3e0749 @zaf Initial commit. Alpha code only for testing.
authored
209 License v2. See COPYING for details.
fd3ecb3 @zaf README updates
authored
210
211 --------
212 Homepage
213 --------
214 http://zaf.github.com/asterisk-googletts/
Something went wrong with that request. Please try again.