Support using 'rbspeak' to generate voice files.

(Full credit to Igor Poretsky)

Change-Id: Ib9c5d2748cd7e0543b7fd110e83b4656089254b8
This commit is contained in:
Solomon Peachy 2018-12-22 20:26:09 -05:00
parent 928557bb17
commit e598ba13f5
2 changed files with 25 additions and 4 deletions

21
tools/configure vendored
View file

@ -1119,6 +1119,14 @@ voiceconfig () {
DEFAULT_NOISEFLOOR="500" DEFAULT_NOISEFLOOR="500"
DEFAULT_CHOICE="w" DEFAULT_CHOICE="w"
fi fi
if [ -n "`findtool rbspeak`" ]; then
RBSPEAK="(O)ther "
RBSPEAK_OPTS=""
DEFAULT_TTS="rbspeak"
DEFAULT_TTS_OPTS=$RBSPEAK_OPTS
DEFAULT_NOISEFLOOR="500"
DEFAULT_CHOICE="O"
fi
# Allow SAPI if Windows is in use # Allow SAPI if Windows is in use
if [ -n "`findtool winver`" ]; then if [ -n "`findtool winver`" ]; then
SAPI="(S)API " SAPI="(S)API "
@ -1129,7 +1137,7 @@ voiceconfig () {
DEFAULT_CHOICE="s" DEFAULT_CHOICE="s"
fi fi
if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ]; then if [ "$FESTIVAL" = "$FLITE" ] && [ "$FLITE" = "$ESPEAK" ] && [ "$ESPEAK" = "$SAPI" ] && [ "$SAPI" = "$SWIFT" ] && [ "$SWIFT" = "$RBSPEAK" ]; then
echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files" echo "You need Festival, eSpeak or Flite in your path, or SAPI available to build voice files"
exit 3 exit 3
fi fi
@ -1137,7 +1145,7 @@ voiceconfig () {
if [ "$ARG_TTS" ]; then if [ "$ARG_TTS" ]; then
option=$ARG_TTS option=$ARG_TTS
else else
echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}(${DEFAULT_CHOICE})?" echo "TTS engine to use: ${FLITE}${FESTIVAL}${ESPEAK}${SAPI}${SWIFT}${RBSPEAK}(${DEFAULT_CHOICE})?"
option=`input` option=`input`
if [ -z "$option" ]; then option=${DEFAULT_CHOICE}; fi if [ -z "$option" ]; then option=${DEFAULT_CHOICE}; fi
advopts="$advopts --tts=$option" advopts="$advopts --tts=$option"
@ -1168,6 +1176,11 @@ voiceconfig () {
NOISEFLOOR="500" NOISEFLOOR="500"
TTS_OPTS=$SWIFT_OPTS TTS_OPTS=$SWIFT_OPTS
;; ;;
[Oo])
TTS_ENGINE="rbspeak"
NOISEFLOOR="500"
TTS_OPTS=$RBSPEAK_OPTS
;;
*) *)
TTS_ENGINE=$DEFAULT_TTS TTS_ENGINE=$DEFAULT_TTS
TTS_OPTS=$DEFAULT_TTS_OPTS TTS_OPTS=$DEFAULT_TTS_OPTS
@ -1213,11 +1226,11 @@ voiceconfig () {
if [ "$swcodec" = "yes" ]; then if [ "$swcodec" = "yes" ]; then
ENCODER="rbspeexenc" ENCODER="rbspeexenc"
ENC_OPTS="-q 4 -c 10" ENC_OPTS="-q 7 -c 10"
else else
if [ -n "`findtool lame`" ]; then if [ -n "`findtool lame`" ]; then
ENCODER="lame" ENCODER="lame"
ENC_OPTS="--resample 12 -t -m m -h -V 9.999 -S -B 64 --vbr-new" ENC_OPTS="-t -m m -h -V 9 -S -B 64 -b 8"
else else
echo "You need LAME in the system path to build voice files for" echo "You need LAME in the system path to build voice files for"
echo "HWCODEC targets." echo "HWCODEC targets."

View file

@ -184,6 +184,14 @@ sub voicestring {
print("> $cmd\n") if $verbose; print("> $cmd\n") if $verbose;
system($cmd); system($cmd);
} }
elsif ($name eq 'rbspeak') {
# xxx: $tts_engine_opts isn't used
$cmd = "rbspeak $output";
print("> $cmd\n") if $verbose;
open(RBSPEAK, "| $cmd");
print RBSPEAK $string . "\n";
close(RBSPEAK);
}
} }
# trim leading / trailing silence from the clip # trim leading / trailing silence from the clip