Access your instance via SSH and execute the following command to run the installation script:
smartupgrade install-pollytts
Please note that SmartUpgrade is a utility unique to AWS FreePBX from TheWebMachine Networks. If you got here by searching the internet and are not using AWS FreePBX from TheWebMachine Networks, you can still use our install-pollytts script and AWS Polly for TTS by running the following command from the root console of your FreePBX server. You do still need to have a valid AWS Account in order to use AWS Polly:
curl https://files.thewebmachine.net/install-pollytts.sh | bash
Towards the end of the installation, you will be asked for the following information:
us-east-1 if not specified
Once the script is finished, you’ll want to add the polly engine via Settings > Text to Speech Engines and specify /usr/bin/node as the Engine Path:
Please be advised of the following limitations when using the AWS Polly engine to create TTS elements:
’ including contractions (use dont instead of don’t), double quotes “, or carriage returns/newlines in your spoken text. Any of these (and possibly other special chars) will break the playback and you will get either only a partial audio file or no audio at all. Polly will automatically pronounce contractions without an apostrophe (like “dont”) correctly
You CAN use Asterisk Channel Variables in your TTS elements, which can greatly expand the variability of the elements you create. You can use variables like ${CALLERID(name)} to say the Caller's name or you can ensure you just speak the Caller's first name using the CUT function like this: ${CUT(CALLERID(name), ,1)} (there is a space between the two comas, which is the delimiter)
That’s it! Now you may create new TTS elements in Applications > Text to Speech and select polly as the engine to use.
install-pollytts again and select a new voice. You'll be asked if you want to delete all existing TTS audio to regenerate elements in the new voice