Installing Text to Speech Utilities in ASL3

Having Text to Speech (TTS) on your node is one of those things that I just can’t live without. You can use it for everything from announcing your nodes call to speaking club announcements. Unfortunately TTS is not included with ASL3 out of the box (at least not at the time I am writing this) but I think this will change.

For TTS to work, you need two things on your node. You need a program that can take a string of text and convert it into audio speech and the second part is telling your AllStar node to play the speech. While I was looking around to build these tools myself, I stumbled across a group (at the ASL3 Github) that has already started to work on it. They now have a package that you can install on your node and it works great. This article will explain how to get it installed and use it.

Installing the ASL-TTS package.

Login to the terminal on your node and enter the following commands (without the $):

NOTE: I am also showing the information here for a Raspberry Pi, if you have ASL3 installed on a PC then you will have to change the name of the package.

$ sudo apt-get install asl3-tts

Now that the package is installed, you can test it to see if it is working. Make sure you are monitoring your node and type in the following (Replace the <NODE_NUMBER> with your node number):

$ sudo asl-tts -n <NODE_NUMBER> -t  " Hello, This is a test "

If all is going well, you should hear your node talk.

Converting test to a speech file.

For some applications, you might want to convert the speech to an audio file that you can store on the node. This is useful for things that you may play over and over again, like your node ID. You can use the same application, just give it the -f argument to specify the file. An example of this is when I am creating audio files for playback for functions, like enabling or disabling parrot mode (See my article here). For this I want to create a file called parrot_mode_enabled.ul. I can do this with the following command (note do not add the .ul extension, it get’s added by the application).

$ sodo asl-tts -n <NODE_NUMBER> -t " Parrot Mode On " -f /etc/asterisk/local/parrot_mode_enabled

2 thoughts on “Installing Text to Speech Utilities in ASL3”

  1. Hi there. Would you mind help me with this IP announcement I found in allstarlink:

    IPADDR=$(wget -q -O – checkip.dyndns.com | grep -Po “[\d\.]+” | sed ‘s/\./ dot /g’)
    MSG=”The node public IP is ${IPADDR}”
    sudo asl-tts -n -t ${MSG}

    when I execute the script/command, I only hear a single “duh” word.

    1. Hi, The script is almost perfect but you just need quotes around the ${MSG} on the asl-tts line. This is needed because asl-tts expects one string so you need make sure it is passed as a single string.

      IPADDR=$(wget -q -O – checkip.dyndns.com | grep -Po “[\d\.]+” | sed ‘s/\./ dot /g’)
      MSG=”The node public IP is ${IPADDR}”
      sudo asl-tts -n -t “${MSG}”

      (Note: You also need the node number after the -n (I assume you just omitted it).

      One other thing is that you should make sure the script is owned by asterisk and executable by the user. If you do that, you don’t need the sudo in from of the asl-tts line. It will make the script a little more secure not to have the sudo.

      Let me know how it goes.

Leave a Comment

Your email address will not be published. Required fields are marked *