#Piper Legacy CLI

1 messages · Page 1 of 1 (latest)

plush vapor
#

I am on Piper addon 1.6.4 and there is a CLI that allows me to perform a simple TTS operation by sending text strings directly to the docker container on port 4545 via netcat, and it returns a WAV file. Works great and I don't have to change docker-compose or add any additional services running on the addon_core_piper container.

Updating to Piper 2.1.1 removes this CLI, I guess in favor of the webserver. https://github.com/OHF-Voice/piper1-gpl/blob/main/docs/API_HTTP.md
But there is no python module named piper in the addon docker container.
Is there an existing CLI or server for Piper docker addon that is accessible from Home Assistant?
I am looking for the easiest path to just create WAV files from text strings.

Thanks.

GitHub

Fast and local neural text-to-speech engine. Contribute to OHF-Voice/piper1-gpl development by creating an account on GitHub.

paper nimbus
plush vapor
#

If so, is there an example of a wyoming request that will output WAV / PCM data?

paper nimbus
plush vapor
shell dome
plush vapor
shell dome
plush vapor
#

Am I expected to Install the python library each time the container starts?
pip install piper-tts is the first line.
I don't see any docs that suggest the addon docker container already has everything installed for me to just use.

shell dome
#

No additional actions are required. Enter the container and check the installed libraries using pip list

plush vapor
#

okay thank you. made progress, but still not there.
This new CLI is nice, but does not include all the functions that the old CLI had. Namely, the built in webserver. Previously, addon_core_piper had a built in API running on port 4545. This new CLI does not, so only docker exec commands can run these commands. This means the HA core container (automations running shell_scripts) cannot access it... which is why I was using netcat.
UPDATE: It wasn't built in... I had run a small shell script in the container that would pipe stdout from netcat listening on 4545, into the piper binary.

Updating to Piper 2.1.1 removes this CLI, I guess in favor of the webserver. https://github.com/OHF-Voice/piper1-gpl/blob/main/docs/API_HTTP.md
-- original post

But, of course, this HTTP API is broken (not fully installed) as it requires Flask which is a requirement, but not included. So again, I have to set up a way to auto install it, and start it up on every container restart. This is a problem since I often need to restart without Internet.

plush vapor
#

Is there a way to get this container permanently and persistently updated with Flask and the HTTP API running at the start of the addon?

shell dome
# plush vapor Is there a way to get this container **permanently and persistently** updated wi...

I don't know what global task you are solving, but if you want to continue receiving wav files via script without leaving HAOS, then create an add-on for your personal needs. It seems that this would be the simplest and most stable option. You will have complete control over the implementation. Alternatively, create a custom component with a service similar to tts.speak, but with the ability to save wav files instead of playing them.

plush vapor
peak crest
#

A wav file is created for every piper tts