From 00cbfa011beb158c0715587d822a7519c1332c3f Mon Sep 17 00:00:00 2001 From: Martin Yeung Date: Sun, 27 Jul 2025 22:40:19 +0100 Subject: [PATCH] Update scripts for compatibility with Piper 1.3.0 CLI --- download_voices_tts-1.bat | 3 +-- download_voices_tts-1.sh | 4 ++-- speech.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/download_voices_tts-1.bat b/download_voices_tts-1.bat index 1939a04..f4097a2 100644 --- a/download_voices_tts-1.bat +++ b/download_voices_tts-1.bat @@ -2,7 +2,6 @@ set models=%* if "%models%" == "" set models=en_GB-northern_english_male-medium en_US-libritts_r-medium -piper --update-voices --data-dir voices --download-dir voices --model x 2> nul for %%i in (%models%) do ( - if not exist "voices\%%i.onnx" piper --data-dir voices --download-dir voices --model %%i > nul + if not exist "voices\%%i.onnx" python -m piper.download_voices --data-dir voices %%i > nul ) diff --git a/download_voices_tts-1.sh b/download_voices_tts-1.sh index cf9da1b..c3db48b 100755 --- a/download_voices_tts-1.sh +++ b/download_voices_tts-1.sh @@ -1,6 +1,6 @@ #!/bin/sh models=${*:-"en_GB-northern_english_male-medium en_US-libritts_r-medium"} # en_US-ryan-high -piper --update-voices --data-dir voices --download-dir voices --model x 2> /dev/null + for i in $models ; do - [ ! -e "voices/$i.onnx" ] && piper --data-dir voices --download-dir voices --model $i < /dev/null > /dev/null + [ ! -e "voices/$i.onnx" ] && python -m piper.download_voices --data-dir voices $i < /dev/null > /dev/null done diff --git a/speech.py b/speech.py index e412e8b..021c5fa 100755 --- a/speech.py +++ b/speech.py @@ -223,7 +223,7 @@ async def generate_speech(request: GenerateSpeechRequest): speaker = voice_map.get('speaker', None) - tts_args = ["piper", "--model", str(piper_model), "--data-dir", "voices", "--download-dir", "voices", "--output-raw"] + tts_args = ["piper", "--model", str(piper_model), "--data-dir", "voices", "--output-raw"] if speaker: tts_args.extend(["--speaker", str(speaker)]) if speed != 1.0: