From 95187f7f7ffcaffcbbf30854a117adfebf731511 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 10 Mar 2024 12:18:53 +0800 Subject: [PATCH] add piper --- README.md | 1 + piper/Dockerfile | 29 +++++++++++++++++++++++++++++ piper/README.md | 17 +++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 piper/Dockerfile create mode 100644 piper/README.md diff --git a/README.md b/README.md index b11406f..b98ecf3 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,7 @@ A collection of delicious docker recipes. - [x] obs-web-arm :joystick: - [x] openmeetings :camera: - [x] paddle-ocr +- [x] piper - [x] plex :moneybag: - [x] red5 :+1: :camera: - [x] red5-arm :construction: :camera: diff --git a/piper/Dockerfile b/piper/Dockerfile new file mode 100644 index 0000000..4851a14 --- /dev/null +++ b/piper/Dockerfile @@ -0,0 +1,29 @@ +# +# Dockerfile for piper +# + +FROM debian:12 +MAINTAINER EasyPi Software Foundation + +ARG PIPER_VERSION=2023.11.14-2 +ARG PIPER_OS=linux +ARG PIPER_ARCH=x86_64 +ARG PIPER_FILE=piper_${PIPER_OS}_${PIPER_ARCH}.tar.gz +ARG PIPER_URL=https://github.com/rhasspy/piper/releases/download/${PIPER_VERSION}/${PIPER_FILE} + +ARG MODEL_BASE_URL=https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium +ARG MODEL_FILE=en_US-lessac-medium.onnx + +WORKDIR /opt/piper + +RUN set -xe \ + && apt update -y \ + && apt install -y curl \ + && curl -sSL ${PIPER_URL} | tar xz --strip 1 \ + && curl -sSL -O ${MODEL_BASE_URL}/${MODEL_FILE} \ + -O ${MODEL_BASE_URL}/${MODEL_FILE}.json \ + && ./piper --version \ + && apt remove -y curl \ + && rm -rf /var/lib/apt/lists/* + +ENTRYPOINT ["./piper", "-m", "en_US-lessac-medium.onnx", "-d", "/tmp"] diff --git a/piper/README.md b/piper/README.md new file mode 100644 index 0000000..d8993ba --- /dev/null +++ b/piper/README.md @@ -0,0 +1,17 @@ +piper +===== + +[piper][1] is a fast, local neural text to speech system that sounds great and is optimized for the Raspberry Pi 4. + +```bash +# Create an alias +$ alias piper='docker run -i --rm -u $(id -u):$(id -g) -v $PWD:/tmp vimagick/piper' + +# Do text-to-speech +$ echo 'Welcome to the world of speech synthesis!' | piper -f /tmp/welcome.wav + +# Play audio +$ play welcome.wav +``` + +[1]: https://github.com/rhasspy/piper