Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Asterisk AGI script that uses Google's translate text to speech service.
Perl
Tag: v0.2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
COPYING
ChangeLog
README
authors
googletts.agi

README

=============================================
       Google TTS script for Asterisk
=============================================

This script makes use of Google's translate text to speech service 
in order to redner text to speech and play it back to the user. 
It supports a variety of different languages.

------------
Requirements
------------
Perl		The Perl Programming Language 
perl-libwww	The World-Wide Web library for Perl
sox			Sound eXchange, sound processing program
mpg123		MPEG Audio Player and decoder
format_sln	Raw slinear module for asterisk
Internet access in order to contact google and get the voice data.

------------
Installation
------------
To install copy googletts.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(googletts.agi,text,language,intkey): This will invoke the Google TTS engine,
render the text string to speech and play it back to the user,
allowing any given interrupt keys to immediately terminate and return.
The script contacts google's TTS service in order to get the voice data 
which then stores in a local cache (by default /tmp/) for future use.
Parameters like default language, enabling or disabling caching and cache dir
can be set up by editing the script.

--------  
Examples
--------
dialplan sample code for your extensions.conf
  
;GoogleTTS Demo

exten => 1234,1,Answer()
  	
	;;Play mesage in English:
exten => 1234,n,agi(googletts.agi,"This is a simple google text to speech test in english.",en,any)
  	
	;;Play message in Spanish
exten => 1234,n,agi(googletts.agi,"Esta es una simple prueba en español.",es,any)
  	
	;;Play message in Greek
exten => 1234,n,agi(googletts,agi,"Αυτό είναι ένα απλό τέστ στα ελληνικά.",el,any)

-------------------
Supported Languages
-------------------
"af" Afrikaans, "sq" Albanian, "am" Amharic, "ar" Arabic, "hy" Armenian, "az" Azerbaijani,
"eu" Basque, "be" Belarusian, "bn" Bengali, "bh" Bihari, "bs" Bosnian, "br" Breton, "bg" Bulgarian,
"km" Cambodian, "ca" Catalan, "zh-CN" Chinese (Simplified), "zh-TW" Chinese (Traditional),
"co" Corsican, "hr" Croatian, "cs" Czech, "da" Danish, "nl" Dutch, "en" English, "eo" Esperanto,
"et" Estonian, "fo" Faroese, "tl" Filipino, "fi" Finnish, "fr" French, "fy" Frisian, "gl" Galician,
"ka" Georgian, "de" German, "el" Greek, "gn" Guarani, "gu" Gujarati, "xx-hacker" Hacker, "ha" Hausa,
"iw" Hebrew, "hi" Hindi, "hu" Hungarian, "is" Icelandic, "id" Indonesian, "ia" Interlingua, "ga" Irish,
"it" Italian, "ja" Japanese, "jw" Javanese, "kn" Kannada, "kk" Kazakh, "rw" Kinyarwanda,
"rn" Kirundi, "xx-klingon" Klingon, "ko" Korean, "ku" Kurdish, "ky" Kyrgyz, "lo" Laothian,
"la" Latin, "lv" Latvian, "ln" Lingala, "lt" Lithuanian, "mk" Macedonian, "mg" Malagasy,
"ms" Malay, "ml" Malayalam, "mt" Maltese, "mi" Maori, "mr" Marathi, "mo" Moldavian, "mn" Mongolian,
"sr-ME" Montenegrin, "ne" Nepali, "no" Norwegian, "nn" Norwegian (Nynorsk), "oc" Occitan, "or" Oriya,
"om" Oromo, "ps" Pashto, "fa" Persian, "xx-pirate" Pirate, "pl" Polish, "pt-BR" Portuguese (Brazil),
"pt-PT" Portuguese (Portugal), "pa" Punjabi, "qu" Quechua, "ro" Romanian, "rm" Romansh, "ru" Russian,
"gd" Scots Gaelic, "sr" Serbian, "sh" Serbo-Croatian, "st" Sesotho, "sn" Shona, "sd" Sindhi,
"si" Sinhalese, "sk" Slovak, "sl" Slovenian, "so" Somali, "es" Spanish, "su" Sundanese, "sw" Swahili,
"sv" Swedish, "tg" Tajik, "ta" Tamil, "tt" Tatar, "te" Telugu, "th" Thai, "ti" Tigrinya, "to" Tonga,
"tr" Turkish, "tk" Turkmen, "tw" Twi, "ug" Uighur, "uk" Ukrainian, "ur" Urdu, "uz" Uzbek,
"vi" Vietnamese, "cy" Welsh, "xh" Xhosa, "yi" Yiddish, "yo" Yoruba, "zu" Zulu.

-------
License
-------
The GoogleTTS script for asterisk is distributed under the GNU General Public 
License v2. See COPYING for details.

Something went wrong with that request. Please try again.