diff --git a/.SRCINFO b/.SRCINFO index 968b945c..5987b896 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = piper-voices-common pkgdesc = Voices for Piper text to speech system (common files) - pkgver = 1.0.0 - pkgrel = 5 + pkgver = 1.0.1 + pkgrel = 1 url = https://huggingface.co/rhasspy/piper-voices install = piper-voices-common.install arch = any @@ -12,11 +12,12 @@ pkgbase = piper-voices-common optdepends = piper-voices-minimal: single voice for en-us optdepends = piper-voices: voices for all languages options = !strip + backup = etc/speech-dispatcher/modules/piper-tts-generic.conf source = https://huggingface.co/rhasspy/piper-voices/resolve/main/voices.json - source = piper-generic.conf + source = piper-tts-generic.conf source = piper-dispatcher b2sums = SKIP - b2sums = 96c0975b956a4c878fcfa5a933fe6e157b0bc40e1973e47b68fd63032bd2112c2c9f712277aac8d1cf9dea833d092c38d3dbb446676e4328855134854219d0b5 - b2sums = 2b5129e2e2fd4cb48602bf5d18052b124b31886cf02268de83d7b687f7e681ab83dc8baeb683c905664d26f4ddab6f86d95fbe3849113c26e5be5c557642810f + b2sums = ad4ff21c47b05bd7aef709c32ee5b1af0add40f070b649df0c62740ed46a19a87920d8099de331fd52c51e13692868630732cbd7ce6b1cc98ede59e831473f3f + b2sums = 2dfdfe1d849ae26928754ec29a5f41036f91a11f9a51d201537bdfc61ff99ecd33c54b44120cb3feeeed28b5053b711e6111fc381f6182832b9909069fb138ce pkgname = piper-voices-common diff --git a/PKGBUILD b/PKGBUILD index 0e7b8365..f03c7c36 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,8 +2,8 @@ _pkgbase="piper-voices" pkgname="$_pkgbase-common" -pkgver=1.0.0 -pkgrel=5 +pkgver=1.0.1 +pkgrel=1 pkgdesc="Voices for Piper text to speech system (common files)" url="https://huggingface.co/rhasspy/$_pkgbase" license=("MIT") @@ -15,17 +15,18 @@ optdepends=( "$_pkgbase: voices for all languages") source=( "https://huggingface.co/rhasspy/$_pkgbase/resolve/main/voices.json" - "piper-generic.conf" + "piper-tts-generic.conf" "piper-dispatcher" ) b2sums=('SKIP' - '96c0975b956a4c878fcfa5a933fe6e157b0bc40e1973e47b68fd63032bd2112c2c9f712277aac8d1cf9dea833d092c38d3dbb446676e4328855134854219d0b5' - '2b5129e2e2fd4cb48602bf5d18052b124b31886cf02268de83d7b687f7e681ab83dc8baeb683c905664d26f4ddab6f86d95fbe3849113c26e5be5c557642810f') + 'ad4ff21c47b05bd7aef709c32ee5b1af0add40f070b649df0c62740ed46a19a87920d8099de331fd52c51e13692868630732cbd7ce6b1cc98ede59e831473f3f' + '2dfdfe1d849ae26928754ec29a5f41036f91a11f9a51d201537bdfc61ff99ecd33c54b44120cb3feeeed28b5053b711e6111fc381f6182832b9909069fb138ce') options=("!strip") install="$pkgname.install" +backup=(etc/speech-dispatcher/modules/piper-tts-generic.conf) package(){ install -D -m 664 "$srcdir/voices.json" -t "$pkgdir/usr/share/$_pkgbase" - install -D -m 664 "$srcdir/piper-generic.conf" -t "$pkgdir/etc/speech-dispatcher/modules" + install -D -m 664 "$srcdir/piper-tts-generic.conf" -t "$pkgdir/etc/speech-dispatcher/modules" install -D -m 775 "$srcdir/piper-dispatcher" -t "$pkgdir/usr/bin" } diff --git a/piper-dispatcher b/piper-dispatcher index 942adc01..3cb72569 100755 --- a/piper-dispatcher +++ b/piper-dispatcher @@ -10,6 +10,12 @@ else RATE=22050 fi -printf %s "$DATA" | piper-tts --model "$VOICES_PATH/$VOICE.onnx" --output-raw | aplay -r "$RATE" -f S16_LE -t raw - +if which pw-play >/dev/null; then + PLAY_APPS="pw-play --rate $RATE --channel-map LE -" +else + PLAY_APPS="aplay -r $RATE -f S16_LE -t raw -" +fi + +printf %s "$DATA" | piper-tts --model "$VOICES_PATH/$VOICE.onnx" -f - | $PLAY_APPS wait diff --git a/piper-generic.conf b/piper-tts-generic.conf similarity index 59% rename from piper-generic.conf rename to piper-tts-generic.conf index df6f15d3..729384ab 100644 --- a/piper-generic.conf +++ b/piper-tts-generic.conf @@ -6,9 +6,8 @@ GenericPunctMost "--punct=\"()[]{};:\"" GenericPunctAll "--punct" GenericExecuteSynth "env DATA="\"$DATA\"" VOICE="\"$VOICE\"" /usr/bin/piper-dispatcher" +#GenericExecuteSynth "echo \'$DATA\' | piper-tts --model /usr/share/piper-voices/\'$VOICE\'.onnx -f - | pw-play --rate 22050 --channel-map LE - " GenericCmdDependency "piper-tts" +GenericDefaultCharset "utf-8" -AddVoice "en" "MALE1" "en/en_US/ryan/high/en_US-ryan-high" - -DefaultVoice "en/en_US/ryan/high/en_US-ryan-high" diff --git a/piper-voices-common.install b/piper-voices-common.install index bc0daf46..01ac37d8 100644 --- a/piper-voices-common.install +++ b/piper-voices-common.install @@ -1,5 +1,26 @@ -post_install(){ - cat < Date: Sat, 17 Jan 2026 11:35:53 +0100 Subject: [PATCH 2/2] Fixed install script --- .SRCINFO | 2 +- PKGBUILD | 2 +- piper-voices-common.install | 16 +++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index 5987b896..83c23793 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = piper-voices-common pkgdesc = Voices for Piper text to speech system (common files) pkgver = 1.0.1 - pkgrel = 1 + pkgrel = 2 url = https://huggingface.co/rhasspy/piper-voices install = piper-voices-common.install arch = any diff --git a/PKGBUILD b/PKGBUILD index f03c7c36..eda2e9c6 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ _pkgbase="piper-voices" pkgname="$_pkgbase-common" pkgver=1.0.1 -pkgrel=1 +pkgrel=2 pkgdesc="Voices for Piper text to speech system (common files)" url="https://huggingface.co/rhasspy/$_pkgbase" license=("MIT") diff --git a/piper-voices-common.install b/piper-voices-common.install index 01ac37d8..fbc8982b 100644 --- a/piper-voices-common.install +++ b/piper-voices-common.install @@ -4,18 +4,20 @@ DEFAULT_MODULE='DefaultModule piper-tts-generic' ADD_MODULE='AddModule "piper-tts-generic" "sd_generic" "piper-tts-generic.conf"' deactivate_setting() { - if grep "^$1" $SPEECHD_CONF; then - while IFS= read -r LINE;do + if grep -q "^$1" $SPEECHD_CONF; then + while IFS= read -r LINE; do sed -i "s/$LINE/# $LINE/" $SPEECHD_CONF - done <<<"$(cat $SPEECHD_CONF | grep "^$1 ")" + done <<<"$(grep "^$1 " $SPEECHD_CONF)" fi } add_line_after() { - if ! grep "$2" $SPEECHD_CONF; then - local line_number=$(cat $SPEECHD_CONF | grep -n "$1" | cut -d: -f1) - line_number=$(( $line_number + 1 )) - sed -i ${line_number}i"$2" $SPEECHD_CONF + if ! grep -q "$2" $SPEECHD_CONF; then + local line_number=$(grep -n "$1" $SPEECHD_CONF | head -1 | cut -d: -f1) + if [ -n "$line_number" ]; then + line_number=$(( line_number + 1 )) + sed -i "${line_number}i$2" $SPEECHD_CONF + fi fi }