-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·56 lines (46 loc) · 1.51 KB
/
setup.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
set -eo pipefail
# based on https://github.com/rhasspy/piper#installation
supportedArchs="amd64|arm64|armv7"
function usage() {
echo "setup mintPiper, usage:"
echo "$0 foldername arch"
echo "supported archs: $supportedArchs"
echo -e "example:\n$0 $HOME/someFolder-$RANDOM amd64"
}
if [ $# -ne 2 ]; then
echo "Invalid usage"
usage
exit 1
fi
weneed="wget aplay tar xclip date xterm"
for i in $weneed; do
command -v $i 1>/dev/null 2>/dev/null || {
echo "Failed. We need $i"
exit 2
}
done
egrep -q $2 <<<$supportedArchs || {
echo "Unsupported architecture $2"
echo "We expect one of these: $supportedArchs"
exit 1
}
runFolder=$(pwd)
mkdir $1/piper -pv
cp silence/silence.wav $1/piper -v
cd $1
echo "🙂 Downloading piper"
# based on https://github.com/rhasspy/piper#installation
wget https://github.com/rhasspy/piper/releases/download/v1.1.0/piper_${2}.tar.gz
tar -xvzf piper_${2}.tar.gz
rm -v piper_${2}.tar.gz
cd piper
echo "🙂 Downloading piper voices"
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/amy/low/en_US-amy-low.onnx https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/amy/low/en_US-amy-low.onnx.json
echo "🙂 Copying mintTTS items"
cp $runFolder/scripts/playSelectedTTS.sh $runFolder/scripts/mintPiper.py $runFolder/images/orange_piper.png . -v
chmod -v +x playSelectedTTS.sh mintPiper.py
echo "✅ ... Complete"
echo "🟢 For keyboard shortcut: xterm -e \"$(pwd)/playSelectedTTS.sh\""
echo "🟢 For panel startup application: $(pwd)/mintPiper.py"