Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 184 lines (161 sloc) 7.308 kb
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
1 ==============================================
2 Speech recognition script for Asterisk
3 ==============================================
7fd57af7 »
2011-12-29 Initial commit
4
5 This script makes use of Google's speech recognition engine
3cbf3601 »
2012-01-10 Typo fix in README
6 in order to render speech to text and return it back to the dialplan
7fd57af7 »
2011-12-29 Initial commit
7 as an asterisk channel variable.
8
9 ------------
10 Requirements
11 ------------
6522d22d »
2012-01-12 README updates
12 Perl The Perl Programming Language
13 perl-libwww The World-Wide Web library for Perl
444c8125 »
2012-05-04 Enabled SSL by default, code cleanup.
14 IO-Socket-SSL Perl module that implements an interface to SSL sockets.
6522d22d »
2012-01-12 README updates
15 flac Free Lossless Audio Codec
7fd57af7 »
2011-12-29 Initial commit
16 Internet access in order to contact google and get the speech data.
17
444c8125 »
2012-05-04 Enabled SSL by default, code cleanup.
18 ** Optional/Highly experimental **
19 speex patent-free audio compression format designed for speech.
20 works only with patched speex encoder that supports
21 MIME "x-speex-with-header-byte"
22 https://github.com/zaf/Speex-with-header-bytes
6522d22d »
2012-01-12 README updates
23
7fd57af7 »
2011-12-29 Initial commit
24 ------------
25 Installation
26 ------------
f2c27e77 »
2011-12-29 Added option for setting up the text language.
27 To install copy speech-recog.agi to your agi-bin directory.
7fd57af7 »
2011-12-29 Initial commit
28 Usually this is /var/lib/asterisk/agi-bin/
29 To make sure check your /etc/asterisk/asterisk.conf file
30
31 -----
32 Usage
33 -----
6522d22d »
2012-01-12 README updates
34 agi(speech-recog.agi,[lang],[timeout],[intkey],[NOBEEP])
f3992eeb »
2013-02-21 Readme updates
35 Records from the current channel until 2 seconds of silence are detected
43783bde »
2012-01-30 Removed absolute recording timeout.
36 (this can be set by the user by the 'timeout' argument, -1 for no timeout) or the
37 interrupt key (# by default) is pressed. If NOBEEP is set, no beep sound is played
38 back to the user to indicate the start of the recording.
6522d22d »
2012-01-12 README updates
39 The recorded sound is send over to googles speech recognition service and the
1c540be4 »
2012-01-07 Added option for user defined timeout. Remove spaces between digits i…
40 returned text string is assigned as the value of the channel variable 'utterance'.
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
41 The scripts sets the following channel variables:
43783bde »
2012-01-30 Removed absolute recording timeout.
42
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
43 status : Return status. 0 means success, non zero values indicating different errors.
44 id : Some id string that googles engine returns, not very useful(?).
45 utterance : The generated text string.
46 confidence : A value between 0 and 1 indicating the probability of a correct recognition.
fd376ebe »
2012-01-05 Added option to use sox. If sox is used the audio gets normalized,
47 Values bigger than 0.95 usually mean that the resulted text is correct.
7fd57af7 »
2011-12-29 Initial commit
48
49 --------
50 Examples
51 --------
52 sample dialplan code for your extensions.conf
53
06afdeb6 »
2012-01-03 Lowered recording timeout to 15sec.
54 ;Simple speech recognition
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
55 exten => 1234,1,Answer()
56 exten => 1234,n,agi(speech-recog.agi,en-US)
44286e83 »
2012-01-18 Removed sox related code.
57 exten => 1234,n,Verbose(1,The text you just said is: ${utterance})
58 exten => 1234,n,Verbose(1,The probability to be right is: ${confidence})
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
59 exten => 1234,n,Hangup()
7fd57af7 »
2011-12-29 Initial commit
60
06afdeb6 »
2012-01-03 Lowered recording timeout to 15sec.
61 ;Speech recognition demo also using googletts.agi for text to speech synthesis:
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
62 exten => 1235,1,Answer()
292eb835 »
2012-01-12 Added option to enable SSL. README updates and diaplan examples.
63 exten => 1235,n,agi(googletts.agi,"Say something in English, when done press the pound key.",en)
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
64 exten => 1235,n(record),agi(speech-recog.agi,en-US)
44286e83 »
2012-01-18 Removed sox related code.
65 exten => 1235,n,Verbose(1,Script returned: ${status} , ${id} , ${confidence} , ${utterance})
58a760cb »
2012-01-18 More README updates
66
67 ;Check return status:
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
68 exten => 1235,n,GotoIf($["${status}" = "0"]?success:fail)
06afdeb6 »
2012-01-03 Lowered recording timeout to 15sec.
69
58a760cb »
2012-01-18 More README updates
70 ;Check the probability of a successful recognition:
292eb835 »
2012-01-12 Added option to enable SSL. README updates and diaplan examples.
71 exten => 1235,n(success),GotoIf($["${confidence}" > "0.8"]?playback:retry)
06afdeb6 »
2012-01-03 Lowered recording timeout to 15sec.
72
58a760cb »
2012-01-18 More README updates
73 ;Playback the text
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
74 exten => 1235,n(playback),agi(googletts.agi,"The text you just said was...",en)
75 exten => 1235,n,agi(googletts.agi,"${utterance}",en)
76 exten => 1235,n,goto(end)
06afdeb6 »
2012-01-03 Lowered recording timeout to 15sec.
77
58a760cb »
2012-01-18 More README updates
78 ;Retry in case speech recognition wasn't successful:
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
79 exten => 1235,n(retry),agi(googletts.agi,"Can you please repeat more clearly?",en)
80 exten => 1235,n,goto(record)
06afdeb6 »
2012-01-03 Lowered recording timeout to 15sec.
81
e0af9f63 »
2012-01-04 Documentation updates. Released as version 0.2
82 exten => 1235,n(fail),agi(googletts.agi,"Failed to get speech data.",en)
83 exten => 1235,n(end),Hangup()
7fd57af7 »
2011-12-29 Initial commit
84
292eb835 »
2012-01-12 Added option to enable SSL. README updates and diaplan examples.
85 ;Voice dialing example
86 exten => 1236,1,Answer()
87 exten => 1236,n,agi(googletts.agi,"PLease say the number you want to dial.",en)
88 exten => 1236,n(record),agi(speech-recog.agi,en-US)
89 exten => 1236,n,GotoIf($[$["${status}" = "0"] & $["${confidence}" > "0.8"]]?success:retry)
90
cd1c3432 »
2012-01-12 Added option for user defined interrupt keys and beep indication.
91 exten => 1236,n(success),goto(${utterance},1)
292eb835 »
2012-01-12 Added option to enable SSL. README updates and diaplan examples.
92
93 exten => 1236,n(retry),agi(googletts.agi,"Can you please repeat?",en)
94 exten => 1236,n,goto(record)
95
58a760cb »
2012-01-18 More README updates
96 Under the folder wolfram you can find a sample agi script that in combination with speech-recog.agi
7a39d14a »
2012-01-17 Added wolfram.agi script
97 sends queries to WolframAlpha and returs the answers as a dialplan variable. See wolfram/README for
98 details and dialplan examples.
99
494d8e84 »
2012-01-07 Added language list
100 -------------------
101 Supported Languages
102 -------------------
024caaa3 »
2013-05-21 Readme updates
103 [['Afrikaans', ['af-ZA']],
104 ['Bahasa Indonesia',['id-ID']],
105 ['Bahasa Melayu', ['ms-MY']],
106 ['Català', ['ca-ES']],
107 ['Čeština', ['cs-CZ']],
108 ['Deutsch', ['de-DE']],
109 ['English', ['en-AU', 'Australia'],
110 ['en-CA', 'Canada'],
111 ['en-IN', 'India'],
112 ['en-NZ', 'New Zealand'],
113 ['en-ZA', 'South Africa'],
114 ['en-GB', 'United Kingdom'],
115 ['en-US', 'United States']],
116 ['Español', ['es-AR', 'Argentina'],
117 ['es-BO', 'Bolivia'],
118 ['es-CL', 'Chile'],
119 ['es-CO', 'Colombia'],
120 ['es-CR', 'Costa Rica'],
121 ['es-EC', 'Ecuador'],
122 ['es-SV', 'El Salvador'],
123 ['es-ES', 'España'],
124 ['es-US', 'Estados Unidos'],
125 ['es-GT', 'Guatemala'],
126 ['es-HN', 'Honduras'],
127 ['es-MX', 'México'],
128 ['es-NI', 'Nicaragua'],
129 ['es-PA', 'Panamá'],
130 ['es-PY', 'Paraguay'],
131 ['es-PE', 'Perú'],
132 ['es-PR', 'Puerto Rico'],
133 ['es-DO', 'República Dominicana'],
134 ['es-UY', 'Uruguay'],
135 ['es-VE', 'Venezuela']],
136 ['Euskara', ['eu-ES']],
137 ['Français', ['fr-FR']],
138 ['Galego', ['gl-ES']],
139 ['Hrvatski', ['hr_HR']],
140 ['IsiZulu', ['zu-ZA']],
141 ['Íslenska', ['is-IS']],
142 ['Italiano', ['it-IT', 'Italia'],
143 ['it-CH', 'Svizzera']],
144 ['Magyar', ['hu-HU']],
145 ['Nederlands', ['nl-NL']],
146 ['Norsk bokmål', ['nb-NO']],
147 ['Polski', ['pl-PL']],
148 ['Português', ['pt-BR', 'Brasil'],
149 ['pt-PT', 'Portugal']],
150 ['Română', ['ro-RO']],
151 ['Slovenčina', ['sk-SK']],
152 ['Suomi', ['fi-FI']],
153 ['Svenska', ['sv-SE']],
154 ['Türkçe', ['tr-TR']],
155 ['български', ['bg-BG']],
156 ['Pусский', ['ru-RU']],
157 ['Српски', ['sr-RS']],
158 ['한국어', ['ko-KR']],
159 ['中文', ['cmn-Hans-CN', '普通话 (中国大陆)'],
160 ['cmn-Hans-HK', '普通话 (香港)'],
161 ['cmn-Hant-TW', '中文 (台灣)'],
162 ['yue-Hant-HK', '粵語 (香港)']],
163 ['日本語', ['ja-JP']],
164 ['Lingua latīna', ['la']]];
494d8e84 »
2012-01-07 Added language list
165
292eb835 »
2012-01-12 Added option to enable SSL. README updates and diaplan examples.
166 -----------------------
167 Security Considerations
168 -----------------------
444c8125 »
2012-05-04 Enabled SSL by default, code cleanup.
169 This script contacts googles' servers in order send the recorded voice data and get back
170 the resulted text. The script uses SSL by default to encrypt all the traffic between
171 your pbx and google servers so no 3rd party can eavesdrop your communication, but your
172 voice data will be available to Google under a not yet defined policy.
292eb835 »
2012-01-12 Added option to enable SSL. README updates and diaplan examples.
173
7fd57af7 »
2011-12-29 Initial commit
174 -------
175 License
176 -------
f2c27e77 »
2011-12-29 Added option for setting up the text language.
177 The speech-recog script for asterisk is distributed under the GNU General Public
7fd57af7 »
2011-12-29 Initial commit
178 License v2. See COPYING for details.
0af7024f »
2012-02-01 Released as version 0.5
179
180 --------
181 Homepage
182 --------
183 http://zaf.github.com/asterisk-speech-recog/
Something went wrong with that request. Please try again.