Skip to content

Commit 0f60f33

Browse files
Add termux-speech-to-text -language
1 parent 0e3f922 commit 0f60f33

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

scripts/termux-speech-to-text.in

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,18 @@ show_usage () {
99
}
1010

1111
show_progress=false
12-
while getopts :hp option
12+
while getopts :hpl: option
1313
do
1414
case "$option" in
1515
h) show_usage;;
1616
p) show_progress=true;;
17+
l) language=${OPTARG};;
1718
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
1819
esac
1920
done
2021
shift $((OPTIND-1))
2122

2223
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
2324

24-
CMD=@TERMUX_PREFIX@/libexec/termux-api
25-
if [ $show_progress = true ]; then
26-
$CMD SpeechToText
27-
else
28-
$CMD SpeechToText | tail -1
29-
fi
25+
CMD=$PREFIX/libexec/termux-api
26+
$CMD SpeechToText --es language ${language:-en-US} | if [ $show_progress = true ]; then cat; else tail -1; fi

0 commit comments

Comments
 (0)