blob: ecb4ee28e9130768543dc58f914470871fde88fc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/env sh
set -e -o pipefail
TTS_MODELS_PATH="$HOME/.config/piper-models"
playaudio() {
ffplay -nodisp -autoexit -f s16le -ar 22050 -
}
text2speech() {
# https://huggingface.co/rhasspy/piper-voices/tree/main/en/en_US
local tts_model="en_US-lessac-medium.onnx";
# local tts_model="en_US-ryan-high.onnx";
# local tts_model="en_US-bryce-medium.onnx";
local tts_model_path="$TTS_MODELS_PATH/$tts_model";
[ -f "$tts_model_path" ] || (echo "Model not found" && exit 1);
piper --model "$tts_model_path" --sentence_silence 0.4 --output-raw | playaudio
}
text2speech;
|