forked from stevenmirabito/asterisk-picotts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
78 lines (63 loc) · 2.52 KB
/
README
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
=============================================
Pico TTS script for Asterisk
=============================================
This script makes use of the SVOX Pico TTS engine in order to
render text to speech and play it back to the user. It supports
a variety of different languages.
------------
Requirements
------------
Perl The Perl Programming Language
sox Sound eXchange, sound processing program
libttspico SVOX Pico TTS engine
picospeaker Command line client for Pico TTS
------------
Installation
------------
To install copy picotts.agi to your agi-bin directory.
Usually this is /var/lib/asterisk/agi-bin/
To make sure check your /etc/asterisk/asterisk.conf file
-----
Usage
-----
agi(picotts.agi,"text",[language],[intkey],[speed]): This will invoke the Pico TTS
engine, render the text string to speech and play it back to the user.
If 'intkey' is set the script will wait for user input. Any given interrupt keys will
cause the playback to immediately terminate and the dialplan to proceed to the
matching extension (this is mainly for use in IVR, see README for examples).
The script invokes PicoSpeaker in order to get the voice data,
which then stores in a local cache (by default /tmp/) for future use.
--------
Examples
--------
sample dialplan code for your extensions.conf
; Pico TTS Demo
; Play back messages to user
exten => 1234,1,Answer()
;;Play mesage in English:
exten => 1234,n,agi(picotts.agi,"This is a simple google text to speech test in english.",en)
;;Play message in Spanish
exten => 1234,n,agi(picotts.agi,"Esta es una simple prueba en español.",es)
;;Play message in Greek
exten => 1234,n,agi(picotts.agi,"Αυτό είναι ένα απλό τέστ στα ελληνικά.",el)
; A simple dynamic IVR using Pico TTS
[my_ivr]
exten => s,1,Answer()
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,agi(picotts.agi,"Welcome to my small interactive voice response menu.",en)
;;Wait for digit:
exten => s,n(start),agi(picotts.agi,"Please dial a digit.",en,any)
exten => s,n,WaitExten()
;;PLayback the name of the digit and wait for another one:
exten => _X,1,agi(picotts.agi,"You just pressed ${EXTEN}. Try another one please.",en,any)
exten => _X,n,WaitExten()
exten => i,1,agi(picotts.agi,"Invalid extension.",en)
exten => i,n,goto(s,start)
exten => t,1,agi(picotts.agi,"Request timed out.",en)
exten => t,n,goto(s,start)
exten => h,1,Hangup()
-------
License
-------
The Pico TTS script for Asterisk is distributed under the GNU General Public
License v2. See COPYING for details.