4 SCRIPTNAME
=termux-tts-speak
6 echo "Usage: $SCRIPTNAME [-e engine] [-l language] [-n region] [-v variant] [-p pitch] [-r rate] [-s stream] [text-to-speak]"
7 echo "Speak text with a system text-to-speech (TTS) engine. The text to speak is either supplied as arguments or read from stdin if no arguments are given."
9 echo " -e engine TTS engine to use (see termux-tts-engines)"
10 echo " -l language language to speak in (may be unsupported by the engine)"
11 echo " -n region region of language to speak in"
12 echo " -v variant variant of the language to speak in"
13 echo " -p pitch pitch to use in speech. 1.0 is the normal pitch,"
14 echo " lower values lower the tone of the synthesized voice,"
15 echo " greater values increase it."
16 echo " -r rate speech rate to use. 1.0 is the normal speech rate,"
17 echo " lower values slow down the speech"
18 echo " (0.5 is half the normal speech rate)"
19 echo " while greater values accelerates it"
20 echo " (2.0 is twice the normal speech rate)."
21 echo " -s stream audio stream to use (default:NOTIFICATION), one of:"
22 echo " ALARM, MUSIC, NOTIFICATION, RING, SYSTEM, VOICE_CALL"
29 while getopts :he
:l
:n
:v
:p
:r
:s
: option
33 e
) PARAMS
="$PARAMS --es engine $OPTARG";;
34 l
) PARAMS
="$PARAMS --es language $OPTARG";;
35 n
) PARAMS
="$PARAMS --es region $OPTARG";;
36 v
) PARAMS
="$PARAMS --es variant $OPTARG";;
37 p
) PARAMS
="$PARAMS --ef pitch $OPTARG";;
38 r
) PARAMS
="$PARAMS --ef rate $OPTARG";;
39 s
) PARAMS
="$PARAMS --es stream $OPTARG";;
40 ?
) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
45 CMD
="@TERMUX_API@ TextToSpeech $PARAMS"