$cd speech_tools $ ./configure $make
$sudo aptitude install libncurses-dev
$cd ../festival $ ./configure $make
(define (language_russian) "(language_russian) Set up language parameters for Russian." (set! male1 voice_msu_ru_nsh_clunits) (male1) (Parameter.set 'Language 'russian) )
(define (select_language language)
((equal? language 'russian) (language_russian))
echo "" | festival --tts --language russian
$INST_DIR/festival/bin/festival --server --language russian
we will not run it into the background yet, let it hang in the terminal for the time of debugging. echo "" | $INST_DIR/festival/bin/festival_client -ttw | aplay
the key -ttw means text to wave, you can run with the key -tts which means text to speech echo "" | $INST_DIR/festival/bin/festival_client -tts
(defvar server_access_list '("192.168.2.1" "127.0.0.1" localhost)
and add the IP address of the host from which you are connecting (although I tried to connect through 127.0.0.1 the server cursed and identified the client as 192.168.2.1, the IP added was all OK). Obviously, they can steer from a remote host, by the way, port 1314 is used for connection, it can be changed both in this config and when launching the client and server with the --port key, of course the client and server ports should be the same. #!/bin/sh ### BEGIN INIT INFO # Provides: helius # Required-Start: $local_fs # Required-Stop: $local_fs # Should-Start: $network # Should-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Festival server # Description: Start Festival daemon as server ### END INIT INFO . /lib/lsb/init-functions PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=festival DESC="Festivale Speech system" DAEMON=/home/eugene/src/festival_src/festival/bin/festival START_MPD= # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 fest_start () { log_daemon_msg "Starting $DESC" "$NAME" start-stop-daemon --start --quiet --oknodo \ --exec "$DAEMON" -- --server --language russian & log_end_msg $? } fest_stop () { log_daemon_msg "Stopping $DESC" "$NAME" start-stop-daemon --stop --quiet --oknodo --retry 5 \ --exec $DAEMON log_end_msg $? } case "$1" in start) fest_start ;; stop) fest_stop ;; restart|force-reload) fest_stop fest_start ;; force-start|start-create-db) FORCE_CREATE_DB=1 fest_start ;; force-restart) FORCE_CREATE_DB=1 fest_stop fest_start ;; *) echo "Usage: $0 {start|start-create-db|stop|restart}" exit 2 ;; esac
$sudo update-rc.d festivald defaults
$sudo /etc/init.d/festivald start
#!/bin/bash <br/>
# <br/>
read str <& 0 <br/>
# <br/>
/ usr / bin / mocp -P <br/>
# <br/>
amixer -c 0 -- sset Master playback 40 <br/>
# <br/>
echo " $str " | festival --tts --language russian<br/>
# <br/>
amixer -c 0 -- sset Master playback 100 <br/>
# <br/>
/ usr / bin / mocp -U <br/>
#!/bin/bash <br/>
# <br/>
read str <& 0 <br/>
# <br/>
/ usr / bin / mocp -P <br/>
# <br/>
amixer -c 0 -- sset Master playback 40 <br/>
# <br/>
echo " $str " | festival --tts --language russian<br/>
# <br/>
amixer -c 0 -- sset Master playback 100 <br/>
# <br/>
/ usr / bin / mocp -U <br/>
#! /bin/bash <br/>
# - <br/>
Nmb = ` curl -u LOGIN:PASSWORD --silent "mail.google.com/mail/feed/atom" | grep -c "<entry>" ` <br/>
# - <br/>
OldNmb = ` cat / home / eugene / mail_count ` <br/>
# - <br/>
if ( ( $Nmb > $OldNmb ) ) <br/>
then <br/>
# , - <br/>
# "" <br/>
if ( ( $Nmb > 1 ) ) <br/>
then <br/>
echo " . " $Nmb | / home / eugene / .bin / sayit<br/>
else <br/>
echo " ." | / home / eugene / .bin / sayit<br/>
fi <br/>
fi <br/>
# - <br/>
echo " $Nmb " >/ home / eugene / mail_count<br/>
<br/>
#! /bin/bash <br/>
# - <br/>
Nmb = ` curl -u LOGIN:PASSWORD --silent "mail.google.com/mail/feed/atom" | grep -c "<entry>" ` <br/>
# - <br/>
OldNmb = ` cat / home / eugene / mail_count ` <br/>
# - <br/>
if ( ( $Nmb > $OldNmb ) ) <br/>
then <br/>
# , - <br/>
# "" <br/>
if ( ( $Nmb > 1 ) ) <br/>
then <br/>
echo " . " $Nmb | / home / eugene / .bin / sayit<br/>
else <br/>
echo " ." | / home / eugene / .bin / sayit<br/>
fi <br/>
fi <br/>
# - <br/>
echo " $Nmb " >/ home / eugene / mail_count<br/>
<br/>
> #!/bin/bash <br/>
# c http://ngs.ru <br/>
wget -P / home / eugene / .tmp http: // ngs.ru -q <br/>
# UTF-8 - <br/>
stringZ = ` cat / home / eugene / .tmp / index.html | iconv -f CP1251 -t UTF- 8 ` <br/>
# <br/>
tmp_str = ` expr " $stringZ " : '.*</a></h2>: \(.........\).*$' ` <br/>
# <br/>
digit = ` expr " $tmp_str " : '^.*\([0-9]\{1,2\}\)' ` <br/>
# <br/>
sign = ` expr " $tmp_str " : '^\(.......\)' ` <br/>
# - "-" <br/>
if [ [ $sign = "−" ] ] <br/>
then <br/>
tmpr = "-" <br/>
fi <br/>
tmpr = $tmpr $digit <br/>
# <br/>
echo $tmpr <br/>
# <br/>
rm / home / eugene / .tmp / index.html
#!/bin/bash <br/>
# <br/>
wget -P / home / eugene / .tmp http: // m.weather.yandex.ru / -q <br/>
# <br/>
stringZ = ` cat / home / eugene / .tmp / index.html<br/>
# <br/>
tmpr = " `expr "$stringZ" : '.*.*....\(..............\)'` " <br/>
# , <br/>
if [ -n " $tmpr " ] # <br/>
then <br/>
# ( : -9 -11) <br/>
tmprhi = ` echo $tmpr | egrep -o '^.?[0-9][0-9]?' ` <br/>
tmprlo = ` echo $tmpr | egrep -o '.?[0-9][0-9]?$' ` <br/>
# <br/>
if ( ( $tmprhi < 0 ) ) # <br/>
then <br/>
shi = "" <br/>
# <br/>
tmprhi = ` echo $tmprhi | egrep -o '[0-9][0-9]?' ` <br/>
else <br/>
shi = " " <br/>
fi <br/>
if ( ( $tmprlo < 0 ) ) # <br/>
then <br/>
slo = "" <br/>
# <br/>
tmprlo = ` echo $tmprlo | egrep -o '[0-9][0-9]?' ` <br/>
else <br/>
slo = " " <br/>
fi <br/>
else <br/>
echo " ." <br/>
exit 0 <br/>
fi <br/>
<br/>
echo " $shi $tmprhi $slo $tmprlo " <br/>
# <br/>
rm / home / eugene / .tmp / index.html
#!/bin/bash <br/>
# <br/>
wget -P / home / eugene / .tmp http: // m.weather.yandex.ru / -q <br/>
# <br/>
stringZ = ` cat / home / eugene / .tmp / index.html<br/>
# <br/>
tmpr = " `expr "$stringZ" : '.*.*....\(..............\)'` " <br/>
# , <br/>
if [ -n " $tmpr " ] # <br/>
then <br/>
# ( : -9 -11) <br/>
tmprhi = ` echo $tmpr | egrep -o '^.?[0-9][0-9]?' ` <br/>
tmprlo = ` echo $tmpr | egrep -o '.?[0-9][0-9]?$' ` <br/>
# <br/>
if ( ( $tmprhi < 0 ) ) # <br/>
then <br/>
shi = "" <br/>
# <br/>
tmprhi = ` echo $tmprhi | egrep -o '[0-9][0-9]?' ` <br/>
else <br/>
shi = " " <br/>
fi <br/>
if ( ( $tmprlo < 0 ) ) # <br/>
then <br/>
slo = "" <br/>
# <br/>
tmprlo = ` echo $tmprlo | egrep -o '[0-9][0-9]?' ` <br/>
else <br/>
slo = " " <br/>
fi <br/>
else <br/>
echo " ." <br/>
exit 0 <br/>
fi <br/>
<br/>
echo " $shi $tmprhi $slo $tmprlo " <br/>
# <br/>
rm / home / eugene / .tmp / index.html
Source: https://habr.com/ru/post/88193/
All Articles