summaryrefslogtreecommitdiffstats
path: root/god/ivan/naturalvoices_cached.sh
blob: 93ac1911ca5732c9759e8fade7fb4cef70fdf58e (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="${voice:-klara}"


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


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

play_file "$OUTFILE"