Package Details: piper-tts-bin 2023.11.14-1

Git Clone URL: https://aur.archlinux.org/piper-tts-bin.git (read-only, click to copy)
Package Base: piper-tts-bin
Description: A fast, local neural text to speech system
Upstream URL: https://github.com/rhasspy/piper
Licenses: MIT
Conflicts: piper-tts
Provides: piper-tts
Submitter: AUR-user
Maintainer: AUR-user
Last Packager: AUR-user
Votes: 12
Popularity: 2.05
First Submitted: 2023-06-28 20:43 (UTC)
Last Updated: 2024-11-17 14:00 (UTC)

Latest Comments

« First ‹ Previous 1 2

Sdar commented on 2023-10-09 14:39 (UTC) (edited on 2023-10-09 14:40 (UTC) by Sdar)

:( i was using this alongside speech dispatcher for using it mainly with mumble (read mute/unmute status and chat messages) but since last update 1.2.0-1 it only works for the first message and then stops working, spd-say does work a little better but sometimes it gets stuck and you have to use pkill sd_generic

I was using this before as speech dispatcher module for piper (1.0.0-1)

GenericExecuteSynth "echo '$DATA' | /usr/lib/piper/piper --model /usr/lib/piper/es-carlfm-x-low.onnx -c /usr/lib/piper/es-carlfm-x-low.onnx.json -f /tmp/speech.wav && $PLAY_COMMAND /tmp/speech.wav"`
GenericCmdDependency "piper-generic"`
AddVoice "es-ES" "MALE1" "es-carlfm-x-low.onnx"`

and changed the first line to the correct (opt folder) path after updating and even tried just calling for piper-tts, as i said it works but not reliably, not sure if it's something with the new package settings or has something to do with the new version.

AUR-user commented on 2023-07-09 09:11 (UTC)

I moved everything to /opt so users can still install espeak-ng in parallel.

Voices and configs shouldn't be part of this package as it would increase size dramatically and I assume in general users need only one or two voices.

The (currently) only user of piper-tts https://aur.archlinux.org/packages/python-wyoming-piper downloads voices and configs automatically if they are not available.

necklace commented on 2023-07-08 15:19 (UTC) (edited on 2023-07-08 19:13 (UTC) by necklace)

Currently this package seems to be putting everything into /usr/lib/ which is not ideal.

The piper binary in this package will also conflict with a command from a package called piper which is in the official extra repo, so I recommend renaming the piper binary to piper-tts.

In addition, piper-tts packages a fork of espeak-ng in the .tar.gz, these files could be a dependency instead but that would have to be separated out as a different AUR package since it is a fork. Instead, a lesser solution is to simply conflict this package with espeak-ng.

So, I propose changing the PKGBUILD to something like this:

pkgname=piper-tts-bin
pkgver=1.0.0
pkgrel=2
pkgdesc="A fast, local neural text to speech system"
arch=('x86_64' 'aarch64')
url="https://github.com/rhasspy/piper"
license=('MIT')
conflicts=('espeak-ng')
provides=('piper-tts')

source_x86_64=("https://github.com/rhasspy/piper/releases/download/v${pkgver}/piper_amd64.tar.gz")
source_aarch64=("https://github.com/rhasspy/piper/releases/download/v${pkgver}/piper_arm64.tar.gz")
sha256sums_x86_64=('6309a3660c28e6b05977831422c1e8c14f63f18175e1bb4e6d802f1dfd096776')
sha256sums_aarch64=('7ad77c0f5f1917f49401bf335b87ccbab803972c055c8abe6967b2e71d1e4c55')

package() {

  install -d ${pkgdir}/usr/share/
  cp -r ${srcdir}/piper/espeak-ng-data ${pkgdir}/usr/share/
  chown -R root:root ${pkgdir}/usr/share/espeak-ng-data
  chmod -R 755 ${pkgdir}/usr/share/espeak-ng-data
  install -D ${srcdir}/piper/libespeak-ng.so ${pkgdir}/usr/lib/libespeak-ng.so
  install -D ${srcdir}/piper/libespeak-ng.so.1 ${pkgdir}/usr/lib/libespeak-ng.so.1
  install -D ${srcdir}/piper/libespeak-ng.so.1.1.51 ${pkgdir}/usr/lib/libespeak-ng.so.1.1.51
  install -D ${srcdir}/piper/libonnxruntime.so.1.14.1 ${pkgdir}/usr/lib/libonnxruntime.so.1.14.1
  install -D ${srcdir}/piper/libpiper_phonemize.so ${pkgdir}/usr/lib/libpiper_phonemize.so
  install -D ${srcdir}/piper/libtashkeel_model.ort ${pkgdir}/usr/share/piper/libtashkeel_model.ort
  install -D -m755 ${srcdir}/piper/piper ${pkgdir}/usr/bin/piper-tts
}

This way, piper is in $PATH and is callable as piper-tts from a terminal, the libs are where they should be and the data in usr/share.

I'm unsure if this package should download the voices and configs from https://github.com/rhasspy/piper/releases/tag/v0.0.2 and huggingface or if they should be split into a separate package. Maybe separate them into language packages, many ways of doing it.

Either way, with this new proposed PKGBUILD I finally got it working after I downloaded the voices:

echo 'Hello, World!' | piper-tts --model en_US-amy-medium.onnx --config en_US-amy-medium.onnx.json

Works!