Announcements on Node

Is it possible to play a scheduled announcement on our local node, like meeting reminders, etc at a certain time of day or hour? If so how would one go about doing it? I’m very new to AllStar and am using HamVoip.
Thanks

Yes, it is possible.
I rather use a cron job than put them on the RPT schedule. Have had plenty of times when the RPT schedule would not work but the cron will always work.
Probably I am talking Chinese to you by mentioning cron jobs as you said you were new to Allstar.

Unless you have voice announcements already in the required format, you’ll want to follow the HamVOIP Text To Speech (TTS) guide:

Then it is a matter of getting the cron daemon setup to run your announcement. To do so, select option 9 from the Admin menu to start a Bash shell. You should get a shell prompt with a # which tell you that you are logged in as “root” or the administrator account.

Type crontab -l and you’ll see several “jobs” already written in the file that have been printed to your screen. One of the jobs will probably look like this:

00 * * * * (source /usr/local/etc/allstar.env ; /usr/bin/nice -19 /usr/bin/perl /usr/local/sbin/saytime.pl $NODE1 > /dev/null)

That looks rather cryptic. The first thing to examine are the ‘00’ and four asterisks (you can see a reference manual (man page) of the crontab syntax by typing man 5 crontab).

In the cron syntax the first field is the minutes field. In this case the command should be run only with the minute of the system time is zero, i.e. the top of the hour. Sometimes you might see a * in that field and that means ‘run this job every minute’, or 00-59.

The second field is the hours. In this case the command will be run each hour, or 00-23.

The third field is the day of the month. In this case the command will be run every day, or 1-31 (odd syntax here as not every month has 31 days).

The fourth field is the month. In this case the command will be run every month, or 1-12.

The fifth field is the day of week. In this case the command will be run every day of the week or 0-7.

Note: The man page notes that names may be used for month and day of the week.

The sixth field is the command to be run.

Putting all of this together shows that this command will be run at the top of every hour of every day of every month regardless of the day of the week.

I wanted to have a TTS announcement run each Sunday from 8:30 AM to 8:30 PM. Once I had the audio file available I copied it to a directory I created for this purpose, /etc/asterisk/local/announcements. Then I used the crontab -e command which will open the crontab file in the default system editor for editing (when the file is saved and editor is closed, the crontab command will do some syntax checking and do what is needed so the cron daemon will have the new job(s) in its queue). I added this line:

30 08-20 * * 0 /usr/bin/asterisk -rx "rpt localplay 519320 /etc/asterisk/local/announcements/announcement_ares"

This job will be run at the 30th minute of the hours of 08 to 20 on Sundays during every month regardless of the calendar day.

I also wanted to run a club meeting announcement but only if the day was the third Thursday of the month. cron lets us choose a day of the week but that will run on all Thursdays, for example. A bit of searching and I found a syntax that restricts the day of the week field to just the third Thursday:

30 08-18 15-21 * * [ "$(date '+\%a')" = "Thu" ] && /usr/bin/asterisk -rx "rpt localplay 519320 /etc/asterisk/local/announcements/announcement_mcarc

Here the command will be run on the 30th minute during the hours of 08 to 18 when the calendar day is the 15 through the 21st AND the day of the week is a Thursday. However, the day of the week field is not used! The command will actually be run during those hours on those calendar days, but the test (the command and comparison in square brackets) and the shell AND comparision operator && limits the actual calling of the /usr/bin/asterisk to only if date returns that this is a Thursday. This is one way that shell command syntax may be used to get around a limitation in the crontab syntax.

This can be modified for another Thursday by adjusting the day of month field. For example, this field value would be changed to 22-28 for the fourth Thursday. Other days of the week can be tested this way.

I’ll admit, this is a rather advanced topic and I tried to distill it to the minimum you need while providing an explanation.

A further note, the example lines I added will work on HamVOIP and ASL2. ASL3 requires the asterisk command line to be changed from localplay to playback.

The directions provided above that relate to the HamVOIP client are not relevant to ASL3.

There are three choices right now:

  1. If it’s something supported by asl-say then use that with a systemd timer or a cron entry.

  2. Create a .ul sound file and call it directly with an asterisk -x 'rpt playback NODE FILE out of cron.

  3. Use the GitHub - AllStarLink/asl3-tts: AllStarLink text to speech system to “speak” the message you want. This tool is new and may contain bugs.

Thanks for information on those options, Jason.

The OP is using HamVOIP, so I hope he has found my post helpful.

I found that when using asl3-tts that to speak a letter group like ARES that adding a hyphen between each letter, i.e., A-R-E-S, speaks each letter individually. I had tried commas but the pause was just too long.

I am creating the speech file(s) and saving them for use on multiple repeaters. Thanks!

Coming from someone who uses speech/TTS/screen readers every day, I will also say that you’ll usually get best results when letters are upper case and separated like that, but this depends on the voice and/or the engine used. The letter a, for example, often gets pronounced as “uh” in lower case. Some combinations still kind of run together, depending on the engine.
On my ASL nodes, I also have DECtalk installed, and I wrote a script that kind of works the same way asl-tts does, where it directly feeds the node with whatever you type to it. This is not a natural sounding voice, per se, but I can directly enter phonemes to get pronunciation and inflection exactly the way I want it. I’m very picky.

Good tips.

I do have A-R-E-S in caps and have three additional voices installed, all en_US, they are hfc-female, kathleen, kristin, and the default amy. Of the four amy seems to slur its way through A-R-E-S the worst but it still understandable to me what is meant. It’s no worse than rock singers!

The voices sound much more natural than another TTS I used. Thanks to Jason for putting this together for ASL3.

1 Like

I just wanted to make folks aware of this project in development, which is slimmer than Piper, and more responsive on slower systems, like Raspberry Pi. May be worth looking into as a substitute for it’s small footprint for future versions of asl3-tts. New models are being trained for it. These models are 24 kHz sampling rate.