diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-11-22 00:43:12 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-11-22 00:45:48 +0530 |
| commit | b8e909d68bcb035648dda93f15de7863f444a3c4 (patch) | |
| tree | 3e6c13b1424d5005b595ea1d86f1b50a49b42390 /scripts/bin/tts | |
| parent | 7cca3043fa585dc0d0cef6a3f25756c946bee1aa (diff) | |
| download | nixos-config-b8e909d68bcb035648dda93f15de7863f444a3c4.tar.gz nixos-config-b8e909d68bcb035648dda93f15de7863f444a3c4.zip | |
Switch to kakoune + daffm
Diffstat (limited to 'scripts/bin/tts')
| -rwxr-xr-x | scripts/bin/tts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/bin/tts b/scripts/bin/tts new file mode 100755 index 0000000..ecb4ee2 --- /dev/null +++ b/scripts/bin/tts @@ -0,0 +1,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; + |
