Salut Ă tous,
Vu que le lapin n'est pas très puissant, voir pas puissant du tout, n'est il pas possible d'installer sur un Raspberry un serveur TTS en local au lieu d'aller taper un serveur internet qui pourrait planter tout le monde ?
function AcapelaTTS {
TTS=$1
VOICE=$2
NOCACHE=$3
RVOICE=$4
MUTE=$5
MD5FILE=""
CURL_PARAM=$(echo "?MyLanguages=sonid15&MySelectedVoice="$RVOICE"&MyTextForTTS="$TTS"&SendToVaaS=&t=1")
RESULT=`eval $(echo "curl --request POST --header "Keep-Alive:300" --header "Connection:keep-alive" --header "Content-type:application/x-www-form-urlencoded" -s --data '${CURL_PARAM}' http://www.acapela-group.com/demo-tts/DemoHTML5Form_V2.php")`
position_depart=$(awk -v a="$RESULT" -v b="var myPhpVar = '" 'BEGIN{print index(a,b)}')
LIEN=${RESULT:${position_depart}+15}
position_fin=$(awk -v a="$LIEN" -v b="'" 'BEGIN{print index(a,b)}')
RESULT=${LIEN:0:${position_fin}-1}
if [ "$RESULT" != "" ]; then
MD5FILE=$(echo "$TTS$VOICE" | md5sum | cut -d ' ' -f 1)
echo $( echo \"$TTS\" | UrlDecode) > $CNF_DATADIR/Tmp/${MD5FILE}.txt
echo $( echo $RVOICE | UrlDecode) > $CNF_DATADIR/Tmp/${MD5FILE}.voice
eval $(echo "curl -L -A '${UA}' -o $CNF_DATADIR/Tmp/${MD5FILE}.mp3 $RESULT" ) >>/dev/null 2>>/dev/null
if [ "$5" != "1" ]; then
Log "[TTS]" "Playing sound ${MD5FILE}.mp3"
PlaySound $CNF_DATADIR/Tmp/${MD5FILE}.mp3
fi
if [ "$NOCACHE" == "1" ]; then
rm -f $CNF_DATADIR/Tmp/${MD5FILE}.mp3 >>/dev/null 2>>/dev/null
rm -f $CNF_DATADIR/Tmp/${MD5FILE}.txt >>/dev/null 2>>/dev/null
else
Log "[TTS]" "Storing sound ${MD5FILE}.mp3 to cache"
fi
fi
echo ${MD5FILE}
}
function GoogleTTS {
TTS=$1
MD5FILE=$(echo "$TTS" | md5sum | cut -d ' ' -f 1)
eval $(echo "curl -A '${UA}' -o $CNF_DATADIR/Tmp/${MD5FILE}.mp3 'http://translate.google.com/translate_tts?tl=fr&q=${TTS}'" ) >>/dev/null 2>>/dev/null
echo $( echo "$RAW_TTS" | UrlDecode) > $CNF_DATADIR/Tmp/${MD5FILE}.txt
PlaySound $CNF_DATADIR/Tmp/${MD5FILE}.mp3
}
function ProsodyTTS {
TTS=$1
VOICE=$2
# Not Working
# Need test
return
MD5FILE=$(echo "$TTS" | md5sum | cut -d ' ' -f 1)
# curl -s -d "$TTS" http://188.165.228.65/tts/Suzanne -o $CNF_DATADIR/Tmp/test.mp3
$(echo "curl -A '${UA}' -o $CNF_DATADIR/Tmp/${MD5FILE}.mp3 -s -data '${TTS}' http://188.165.228.65/tts/${VOICE}" ) >>/dev/null 2>>/dev/null
echo $( echo "$RAW_TTS" | UrlDecode) > $CNF_DATADIR/Tmp/${MD5FILE}.txt
PlaySound $CNF_DATADIR/Tmp/${MD5FILE}.mp3
}
chmod 777 /usr/www/cgi-bin/tts.inc
dos2unix /usr/www/cgi-bin/tts.inc
Pitt13 a écrit:Bonsoir,
Pouvez vous decrire la procédure pour effectuer ce changement svp ?
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 5 invités