Commit | Line | Data |
---|---|---|
59f0d218 FF |
1 | #!/system/bin/sh |
2 | ||
3 | set -u | |
4 | ||
5 | PARAMS="" | |
6 | ||
7 | SCRIPTNAME=$0 | |
8 | show_usage () { | |
9 | echo "usage: $SCRIPTNAME [OPTIONS]" | |
10 | echo "" | |
11 | echo "Speak with a device text-to-speech (TTS) engine." | |
12 | echo "Find out about valid options with the device-tts-engines program." | |
13 | echo " -e, --engine <engine> TTS engine to use" | |
14 | echo " -l, --language <language> language to speak in (may be unsupported by the engine)" | |
15 | echo " -p, --pitch <pitch> pitch to use in speech" | |
16 | echo " -r, --rate <rate> rate to use in speech" | |
17 | } | |
18 | ||
19 | O=`busybox getopt -q -l engine: -l help -l language: -l pitch: -l rate: -- e:hl:p:r: "$@"` | |
20 | if [ $? != 0 ] ; then show_usage; exit 1 ; fi | |
21 | eval set -- "$O" | |
22 | while true; do | |
23 | case "$1" in | |
24 | -e|--engine) PARAMS="$PARAMS --es engine $2"; shift 2;; | |
25 | -l|--language) PARAMS="$PARAMS --es language $2"; shift 2;; | |
26 | -p|--pitch) PARAMS="$PARAMS --ef pitch $2"; shift 2;; | |
27 | -r|--rate) PARAMS="$PARAMS --ef rate $2"; shift 2;; | |
28 | -h|--help) show_usage; exit 0;; | |
29 | --) shift; break;; | |
30 | *) echo Error; exit 1;; | |
31 | esac | |
32 | done | |
33 | ||
f77975aa | 34 | termux-api SpeechToText $PARAMS |