[arm-allstar] Randomizing Hourly ID Messages
Patrick Perdue
borrisinabox at gmail.com
Sun Apr 23 14:38:54 EDT 2023
Hi Josh:
FWIW: if you are recording your own ID's, using ULAW, SLN or wav will
sound better over the air than GSM. For wav, use 8 kHz, 16-bit linear
PCM mono, or for SLN, same format but with no header (RAW PCM.) I
personally use SLN, but for all intents and purposes, it probably
doesn't matter too much. They're all better than GSM, and you'll never
hear the full dynamic range of linear PCM on a radio anyway.
As far as the ID selection, you could do something like this.
Create a bash script that selects and plays a random ID, then insert it
into your existing cronjob.
create/edit /etc/asterisk/local/hourly-id.sh
put this into the file. Change path if relevant.
#!/bin/bash
# set the path for your hourly ID directory
path="/var/lib/asterisk/sounds/hourly-ids"
if [ -e "$path" ]
then
id=`find "$path" -type f|shuf -n1`
# play the randomly selected ID to NODE1 as defined in
/usr/local/etc/allstar.env
asterisk -rx "rpt playback $NODE1 $(echo ${id%.*})
else
echo "$path not found"
fi
Save and exit, then make this script executable:
chmod +x /etc/asterisk/local/random-id.sh
Now, edit your crontab:
crontab -e
and change the line that fires your saytime script to include the
hourly-id.sh script, with any existing parameters. Mine is just the
default, doesn't give weather conditions.
00 0-23 * * * (source /usr/local/etc/allstar.env ;
/etc/asterisk/local/hourly-id.sh ; /usr/bin/nice -19 /usr/bin/perl
/usr/local/sbin/saytime.pl $NODE1 > /dev/null)
HTH. I should probably admit that I haven't tested this, but I'm pretty
sure it will work.
73
N2DYI
On 4/23/2023 1:07 PM, Josh Hatton via ARM-allstar wrote:
> Afternoon All
>
> I built a HamVoIP controller for a small group recently - They love the
> system - They had an idea to randomize the hourly IDs with several Voice
> IDs.
>
> It doesn't seem it would be too hard to cycle through IDs, but
> "randomizing" them could be the challenging part.
>
> They like the idea of hearing a random message first, then the time and
> wx/temperature (time/temp already in place via rpt.conf).
>
> What am I looking at coding-wise to randomize a few .gsm files, followed by
> the asterisk time/temp? If randomizing would be tough, even just playing
> one file every hour, in order from a list file, each followed by the
> time/temp would be great.
>
> Your thoughts, ideas etc are appreciated.
>
> 73 Josh W4ZZK
> _______________________________________________
>
> ARM-allstar mailing list
> ARM-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3/4 web page - http://hamvoip.org
More information about the ARM-allstar
mailing list