TTS Engine Path

Hello World,

I recently downloaded (SNG7-PBX16-64bit-2204-1.iso) and installed FreePBX 16.0.21.3 with all the defaults. I updated all the modules afterward.

However, I notice none of the “Text to Speech Engine” has an “Engine Path”. I have been trying to Google for this issue, but nothing really helps, other than only be able to locate flite is using /usr/bin/flite.

I see a bit of using Amazon/Google/Watson but it is a bit complicated for now. I was hoping to test out other TTS that suppose to come with the install.

you can compare yourself. . .

flite doesn’t cut it in 2022 .
amazon, google cloud, and ibm (also micosoft azure) all need a ‘free’ account set up which is indeed a little ‘complicated’ and down line ‘not so free’

Try

https://gtts.readthedocs.io/en/latest/cli.html

then

/usr/local/bin/gtts-cli

will convert as much text as you want freely to an mp3 file with a female voice in a provincial accent of several languages
(you will need to RTFM to get the best out if it though :wink: )

Yea, flite doesn’t really cut it…

I was hoping for a better out-of-the-box experience with FreePBX… I do know a bit of Linux, but again, none of the commands I know works. No apt, apt-get, pip, ipkg,opkg…

And that still begs the question… What are the default engine paths for all those TTS engines (e.g. text2wave, swift, pico, polly) listed in the default installation?

The ‘Distro’ is RedHat based, You apparently qre Debian based, there is a world of difference between essentially the same 'things

You need to learn a new dialect or follow an open source install into an OS of your choice, many recipes in the above linked wiki .

Oh… haha. yes, I have forget about yum! :slight_smile:

yep, the ‘yellowdog update manager’ perfect fit in 2022

OK, still not much luck finding out how to install gTTS or figuring out the paths for the other TTS Engines.

https://gtts.readthedocs.io/en/latest/

it needs python3, so install that and pip3 if you don’t alrwady have them, then use pip3 not pip from that link to make sure you are using python3

then

which flite
which gtts-cli
which (whatever name  your chosen tts install into)

OK… I guess my linux skill is a bit outdated with RH distro…

Tried yum install python3

Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package python3.x86_64 0:3.6.8-13.el7 will be installed
--> Processing Dependency: python3-libs(x86-64) = 3.6.8-13.el7 for package: python3-3.6.8-13.el7.x86_64
--> Processing Dependency: python3-setuptools for package: python3-3.6.8-13.el7.x86_64
--> Processing Dependency: python3-pip for package: python3-3.6.8-13.el7.x86_64
--> Running transaction check
---> Package python3-libs.x86_64 0:3.6.8-13.el7 will be installed
---> Package python3-pip.noarch 0:9.0.3-7.el7_7 will be installed
---> Package python3-setuptools.noarch 0:39.2.0-10.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                 Arch        Version             Repository        Size
================================================================================
Installing:
 python3                 x86_64      3.6.8-13.el7        sng-base          69 k
Installing for dependencies:
 python3-libs            x86_64      3.6.8-13.el7        sng-base         7.0 M
 python3-pip             noarch      9.0.3-7.el7_7       sng-updates      1.8 M
 python3-setuptools      noarch      39.2.0-10.el7       sng-base         629 k

Transaction Summary
================================================================================
Install  1 Package (+3 Dependent packages)

Total size: 9.4 M
Installed size: 48 M
Downloading packages:
Running transaction check
Running transaction test
[... skipped lots of messages about conflicts ...]
  file /usr/lib64/python3.6/xml/sax/__pycache__/xmlreader.cpython-36.opt-2.pyc from install of python3-libs-3.6.8-13.el7.x86_64 conflicts with file from package python36u-libs-3.6.7-1.ius.centos7.x86_64
  file /usr/lib64/python3.6/xml/sax/__pycache__/xmlreader.cpython-36.pyc from install of python3-libs-3.6.8-13.el7.x86_64 conflicts with file from package python36u-libs-3.6.7-1.ius.centos7.x86_64
  file /usr/lib64/python3.6/zipfile.py from install of python3-libs-3.6.8-13.el7.x86_64 conflicts with file from package python36u-libs-3.6.7-1.ius.centos7.x86_64
  file /usr/bin/python3.6m from install of python3-3.6.8-13.el7.x86_64 conflicts with file from package python36u-3.6.7-1.ius.centos7.x86_64
  file /usr/bin/python3.6 from install of python3-3.6.8-13.el7.x86_64 conflicts with file from package python36u-3.6.7-1.ius.centos7.x86_64

Error Summary
-------------

I have never had so much trouble with any default Linux installations… Maybe I should try an older FreePBX ISO or another distro… :thinking:

=-=-=-=-=-=-

UPDATE:

Found another post suggesting a yum install python34 which seems to work. However, when I do a python --version it is still showing Python 2.7.5.

Sorry. I am just not impressed with FreePBX distro at the moment…

Maybe once you get a little more current with your skills you will become more impressed at all that the FreePBX distro can do.

Sure. But at least can someone show me the commands or what needs to be done?

As dicko said, yum is old and outdated, but that’s the only command that seems to work. There is no dnf come with the distro either. I am not sure what else to try.

Even if my RH(?) skill is more current, I am still not impressed with the out-of-the-box experience with this distro. Starting with the missing path for TTS Engines… which gets me into this rabbit hole.

This is really making people jumping through hoops…

[[email protected] ~]# which python
/usr/bin/python
[[email protected] ~]# ls -la /usr/bin/python
lrwxrwxrwx. 1 root root 7 Jul  8 14:16 /usr/bin/python -> python2
[[email protected] ~]# which python2
/usr/bin/python2
[[email protected] ~]# ls -la /usr/bin/python2
lrwxrwxrwx. 1 root root 9 Jul  8 14:16 /usr/bin/python2 -> python2.7
[[email protected] ~]# which python2.7
/usr/bin/python2.7
[[email protected] ~]# ls -la /usr/bin/python2.7
-rwxr-xr-x. 1 root root 7144 Apr  2  2020 /usr/bin/python2.7
[[email protected] ~]# ls -la /usr/bin/python*
lrwxrwxrwx. 1 root root     7 Jul  8 14:16 /usr/bin/python -> python2
lrwxrwxrwx. 1 root root     9 Jul  8 14:16 /usr/bin/python2 -> python2.7
-rwxr-xr-x. 1 root root  7144 Apr  2  2020 /usr/bin/python2.7
-rwxr-xr-x  2 root root 11312 Jul 30  2020 /usr/bin/python3.4
-rwxr-xr-x  2 root root 11312 Jul 30  2020 /usr/bin/python3.4m
-rwxr-xr-x. 2 root root 11376 Dec  5  2018 /usr/bin/python3.6
-rwxr-xr-x. 2 root root 11376 Dec  5  2018 /usr/bin/python3.6m
[[email protected] ~]# ln -s /usr/bin/python3.6 /usr/bin/python
ln: failed to create symbolic link ‘/usr/bin/python’: File exists
[[email protected] ~]# rm /usr/bin/python
rm: remove symbolic link ‘/usr/bin/python’? y
[[email protected] ~]# ln -s /usr/bin/python3.6 /usr/bin/python
[[email protected] ~]# python --version
Python 3.6.7
[[email protected] ~]# yum list
  File "/usr/bin/yum", line 30
    except KeyboardInterrupt, e:
                            ^
SyntaxError: invalid syntax

This is just great… sigh

There aren’t any TTS engines that come with FreePBX Distro… you have to install them yourself. I guess that’s what is confusing you.

E.g. to install Cepstral (Swift) - Cepstral - Download IVR/Telephony system TTS software

Follow their instructions to install it on your PBX and then go to the TTS Engines module in FreePBX to tell it where the swift binary is.

Or if you write a script to send text to Amazon Polly or Azure TTS engine and get the result back, you can point to that script.

Or install an open source engine, which seems to be what you are doing, but it’s probably the most difficult way and requires you to have a bit more linux skill.

ps: also just found a script written for Polly… check it out https://www.thewebmachine.net/wiki/freepbx-general/installing-aws-polly-tts-better-picotts-alternative

E.g. to install Cepstral (Swift) - Cepstral - Download IVR/Telephony system TTS software

OK, the installation works, but pretty useless because it requires purchasing a license to work. Unless I am missing something.

found a script written for Polly… check it out https://www.thewebmachine.net/wiki/freepbx-general/installing-aws-polly-tts-better-picotts-alternative

OK, this is a bit more adventurous. Learned AWS along the way too. Installation seems to do its job. Added /usr/bin/node under polly in TTS Engines. But it is not working.

[2022-07-11 16:56:43] VERBOSE[23495][C-00000026] res_agi.c: agi://127.0.0.1/propolys-tts.agi,"Thank you for calling. Our local time is ",polly,/usr/bin/node: TTS AGI Started	
[2022-07-11 16:56:43] VERBOSE[23495][C-00000026] res_agi.c: agi://127.0.0.1/propolys-tts.agi,"Thank you for calling. Our local time is ",polly,/usr/bin/node: Generated WAV file: /var/lib/asterisk/sounds/tts/polly-tts-01c0aeeca516d2d39504c105ba891317.sln	
[2022-07-11 16:56:43] VERBOSE[23495][C-00000026] res_agi.c: agi://127.0.0.1/propolys-tts.agi,"Thank you for calling. Our local time is ",polly,/usr/bin/node: TXT file: /var/lib/asterisk/sounds/tts/polly-tts-01c0aeeca516d2d39504c105ba891317.txt	
[2022-07-11 16:56:43] VERBOSE[23495][C-00000026] res_agi.c: agi://127.0.0.1/propolys-tts.agi,"Thank you for calling. Our local time is ",polly,/usr/bin/node: Text to speech wave file doesnt exist, lets create it.	
[2022-07-11 16:56:43] VERBOSE[23495][C-00000026] res_agi.c: agi://127.0.0.1/propolys-tts.agi,"Thank you for calling. Our local time is ",polly,/usr/bin/node: Executing polly	
[2022-07-11 16:56:43] VERBOSE[23495][C-00000026] res_agi.c: agi://127.0.0.1/propolys-tts.agi,"Thank you for calling. Our local time is ",polly,/usr/bin/node: File was not created!	
[2022-07-11 16:56:43] VERBOSE[23495][C-00000026] res_agi.c: agi://127.0.0.1/propolys-tts.agi,"Thank you for calling. Our local time is ",polly,/usr/bin/node: TTS AGI end	
[2022-07-11 16:56:43] VERBOSE[23495][C-00000026] res_agi.c: <PJSIP/701-00000031>AGI Script agi://127.0.0.1/propolys-tts.agi completed, returning 0
/usr/bin/node /opt/aws-nodejs/polly.js --mp3=/var/lib/asterisk/sounds/tts/test-tts-test.mp3 --text='THIS IS A TEST' --wav=/var/lib/asterisk/sounds/tts/test-tts-temp-test
AccessDeniedException

Oh boy, this is no smooth sailing… I have checked polly.js with the correct KeyId, AccessKey, region ‘ca-central-1’ and VoiceId ‘Joanna’ Gosh, what am I getting into.

Gosh. Finally, get polly to work… from bits and pieces of AWS document, the policy is called “AmazonPollyFullAccess”, once added to the user permission, it finally works.

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.