Piper-speak: an espeak-style C++ commandline front-end for libpiper #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired by issue#56 and my general frustration of not having an better sounding alternative to espeak that is easy-to-install on Linux, I decided to try my hand at writing a C++ front-end to libpiper. Currently, it supports reading from stdin, reading a text file passed on the commandline and reading the command-line first argument.
Since piper1 depends on espeak-ng, I used espeak-ng's audio library pcaudiolib to play audio. I have a pull request with the documentation I reconstructed for it currently open.
There are many obvious features to yet implement and ways the code could be improved. For example, an option to select the voice instead of just using the first one in directory or an option to pick the speed or noise or audio output device. Offering a way to save to a wav file would help reach feature parity with espeak.
Many of the various weaknesses of code are noted in comments. For example, when reading a file, the entire file is loaded into memory and sent to libpiper at once. This could cause problems if the file is large enough that doesn't fit into memory.
Currently, the CMakeLists.txt for it builds against the system's copy of pcaudiolib, but for the other dependencies, it uses the copies of the onnx runtime and espeak-ng from following the libpiper README.txt instructions. It needs some modification to make the built binary installable. You have to manually download a voice and place it into the voices directory. I am not sure what is the correct policy for voices. Perhaps automatically downloading a single English voice would be an appropriate action during the build process to make the software work without any manual actions, assuming that such bundling is permitted by licensing.
My understanding is that libpiper is waiting on the new version of espeak-ng to either release or fully roll out before switching to building against the system copy of espeak-ng and onnx. So fully fixing piper-speak's build system likely should wait until then.
Piper-speak currently targets c++17 because I didn't see any particular c++ version to target elsewhere in the code and I wanted to use
std::filesystemso I didn't target any older.I make a pull request now, rather than when the piper-speak is blemish free and feature complete, to get feedback and gauge interest.