summaryrefslogtreecommitdiffstats
path: root/god/ivan/naturalvoices_cached.sh
blob: d64d9b78c918c9856bdfc474cb4a70721af651c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# The cached version of naturalvoices
# This should prevent us from being pwned again ...

. ../../util/lib/naturalvoices/att.sh

: ${1?what to say?Please provide text as parameter.}

text=$(echo $* | sed -e 's/ /+/g' -e 's/\//%2F/g')
voice="klara"


CACHE_DIR="/tmp/ivan-speech"
mkdir -p "$CACHE_DIR"
OUTFILE="$CACHE_DIR/${text}.wav"


if [ ! -e $OUTFILE ] ;then
    echo "Downloading $OUTFILE"
    get_tts "$text"
else
    echo "using cached version of $OUTFILE"
fi

play_file "$OUTFILE"