Skip to content

A simple class that can be used with phpagi to generate tts voices using google translate API

Notifications You must be signed in to change notification settings

csiwek/googletts-phpagi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

About

This is a simple TTS based on perl version: https://github.com/zaf/asterisk-googletts Uses Google Translate API

Installation

just clone the repository

Requirements

You need to have:

Usage

look at the example.php file. Just run it as an AGI script from Asterisk's Dialplan:

To generate text in default language with default speeed

$tts->say_tts("This is a test");  

To generate text in Polish, with default speeed

$tts->say_tts("To jest test", 'pl');  

To generate text in Polish, with speeed x2

$tts->say_tts("To jest test", 'pl', 2);

To generate text in Polish, with speeed x2, without answering the call (will play file as early media)

$tts->say_tts("To jest test", 'pl', 2, 'noanswer');

exensions.conf may look like this:

exten => 602,1,Noop()
exten => 602,n,agi(gtts/example.php)

Remarks

  • The input text must be UTF-8 encoded.
  • Sometimes does not work if the input stting is too long. If so, try splitting to shorter parts. I think that happens because of some limitations on google side.
  • sounds are automatically cached in /tmp

Author

Cezary Siwek ([email protected])

About

A simple class that can be used with phpagi to generate tts voices using google translate API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages