AllStarLink3 TTS and audio files: Difference between revisions

From WLPS Wiki
Jump to navigation Jump to search
mNo edit summary
m (Wodie moved page Play Local Audio Files to AllStarLink3 TTS and audio files without leaving a redirect)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
=Install Piper for TTS =


Install asl3-tts.


Audio files need to be in:
<pre>
sudo apt install asl3-tts
</pre>
 
Test it:
 
<pre>
sudo asl-tts -n 649803 -t 'Good morning'
</pre>
 
Add a cleaning crontab so we not fill the memmory card.
 
<pre>
sudo crontab -e
</pre>
 
Add at the end to clean weekly.
 
<pre>
0 0 1 * * rm -rf /tmp/asl-tts*
</pre>
 
= Other languages =
 
Download Spanish voice file.
 
<pre>
sudo wget  -P /var/lib/piper-tts  https://huggingface.co/rhasspy/piper-voices/resolve/main/es/es_MX/claude/high/es_MX-claude-high.onnx
sudo wget  -P /var/lib/piper-tts  https://huggingface.co/rhasspy/piper-voices/resolve/main/es/es_MX/claude/high/es_MX-claude-high.onnx.json
</pre>
 
Test Spanish TTS.
 
<pre>
sudo asl-tts -n 649880 -v es_MX-claude-high.onnx  -t  ‘Usuario no autorizado. Grabación activada, triangulación en proceso.’
<pre>
 
= Create permanent audio files =
 
<pre>
AUD_TEXT="Usuario no autorizado. Grabación activada, triangulación en proceso."


/var/lib/asterisk/sounds
sudo asl-tts  -n 649804  -v es_MX-claude-high.onnx  -t "${AUD_TEXT}"  -f /var/lib/asterisk/sounds/custom/UsusarioNoAutorizado
 
sudo /usr/sbin/asterisk -rx "rpt localplay 649804 /var/lib/asterisk/sounds/custom/UsusarioNoAutorizado"
</pre>
 
= Misc =
 
Audio files will be stored:
 
<pre>
/var/lib/asterisk/sounds/custom
</pre>


Next create a script like this replacing 1111 with your node number. Note there is no file extension.
Next create a script like this replacing 1111 with your node number. Note there is no file extension.
Line 12: Line 65:
</pre>
</pre>


Now add it to crontab
Now add it to crontab.


sudo nano /etc/crontab
<pre>
sudo nano /etc/crontab
</pre>


Add the lines as you need at the end of the file.
Add the lines as you need at the end of the file.
Line 20: Line 75:
  */1    *      *      *      *      root    /home/repeater/asterisk/audiotest.sh > /dev/null 2>&1
  */1    *      *      *      *      root    /home/repeater/asterisk/audiotest.sh > /dev/null 2>&1


Reload Crontab.


Reload Crontab
<pre>
sudo service cron reload
</pre>


sudo service cron reload
Test:


 
<pre>
 
sudo /usr/sbin/asterisk -rx "rpt localplay 1111 /var/lib/asterisk/sounds/you-seem-impatient"
Test
</pre>
 
sudo /usr/sbin/asterisk -rx "rpt localplay 64980 /var/lib/asterisk/sounds/you-seem-impatient"

Latest revision as of 23:14, 11 July 2025

Install Piper for TTS

Install asl3-tts.

sudo apt install asl3-tts

Test it:

sudo asl-tts -n 649803 -t 'Good morning'

Add a cleaning crontab so we not fill the memmory card.

sudo crontab -e

Add at the end to clean weekly.

	0	0	1	*	*	rm -rf /tmp/asl-tts*

Other languages

Download Spanish voice file.

sudo wget   -P /var/lib/piper-tts   https://huggingface.co/rhasspy/piper-voices/resolve/main/es/es_MX/claude/high/es_MX-claude-high.onnx
sudo wget   -P /var/lib/piper-tts   https://huggingface.co/rhasspy/piper-voices/resolve/main/es/es_MX/claude/high/es_MX-claude-high.onnx.json

Test Spanish TTS.

sudo asl-tts -n 649880 -v es_MX-claude-high.onnx   -t   ‘Usuario no autorizado. Grabación activada, triangulación en proceso.’
<pre>

= Create permanent audio files =

<pre>
AUD_TEXT="Usuario no autorizado. Grabación activada, triangulación en proceso."

sudo asl-tts   -n 649804   -v es_MX-claude-high.onnx   -t "${AUD_TEXT}"   -f /var/lib/asterisk/sounds/custom/UsusarioNoAutorizado

sudo /usr/sbin/asterisk -rx "rpt localplay 649804 /var/lib/asterisk/sounds/custom/UsusarioNoAutorizado"

Misc

Audio files will be stored:

/var/lib/asterisk/sounds/custom

Next create a script like this replacing 1111 with your node number. Note there is no file extension.

#! /bin/bash
/usr/sbin/asterisk -rx "rpt localplay 1111 myaudiofile"

Now add it to crontab.

sudo nano /etc/crontab

Add the lines as you need at the end of the file.

*/1     *       *       *       *       root    /home/repeater/asterisk/audiotest.sh > /dev/null 2>&1

Reload Crontab.

sudo service cron reload

Test:

sudo /usr/sbin/asterisk -rx "rpt localplay 1111 /var/lib/asterisk/sounds/you-seem-impatient"