Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
path: |
piper1-gpl/libpiper/build/libpiper.so
piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/lib/libonnxruntime.so
piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/espeak-ng-data
piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/share/espeak-ng-data
retention-days: 7


Expand All @@ -131,12 +131,12 @@ jobs:
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
container: alpine:3.18
container: alpine:3.23

steps:
- name: Install git and build dependencies
run: |
apk add --no-cache cmake build-base git linux-headers pkgconfig
apk add --no-cache cmake build-base git linux-headers pkgconfig onnxruntime-dev

- uses: actions/checkout@v7
with:
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
mkdir -p libs
cp piper1-gpl/libpiper/build/libpiper.so libs/
cp piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/lib/libonnxruntime.so* libs/
cp -r piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/espeak-ng-data libs/
cp -r piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/share/espeak-ng-data libs/

- name: Cache voice model
uses: actions/cache@v6
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
tar -czf libpiper-linux-x86_64.tar.gz -C piper1-gpl/libpiper/build libpiper.so
mkdir -p /tmp/onnx && find piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/lib -name "libonnxruntime*.so*" -exec cp -P {} /tmp/onnx/ \; && tar -czf libonnxruntime-linux-x86_64.tar.gz -C /tmp/onnx .
tar -czf espeak-ng-data.tar.gz -C piper1-gpl/libpiper/build/piper1-gpl/libpiper/install espeak-ng-data
tar -czf espeak-ng-data.tar.gz -C piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/share espeak-ng-data

- name: Upload packaged artifacts
uses: actions/upload-artifact@v7
Expand All @@ -58,12 +58,12 @@ jobs:

build-piper-musl:
runs-on: ubuntu-latest
container: alpine:3.18
container: alpine:3.23

steps:
- name: Install git and build dependencies
run: |
apk add --no-cache cmake build-base git linux-headers pkgconfig
apk add --no-cache cmake build-base git linux-headers pkgconfig onnxruntime-dev

- uses: actions/checkout@v7
with:
Expand All @@ -75,20 +75,20 @@ jobs:
- name: Strip debug symbols
run: |
strip --strip-debug piper1-gpl/libpiper/build/libpiper.so
find piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/lib -name "libonnxruntime.so.*" -type f -exec strip --strip-debug {} + 2>/dev/null || true

- name: Package build artifacts
run: |
# The prebuilt ONNX Runtime that libpiper downloads is glibc-only, so this job links
# the Alpine package (onnxruntime-dev). It is not shipped: Alpine users install it with
# `apk add onnxruntime-dev`. The espeak-ng data is the same for glibc and musl.
tar -czf libpiper-linux-musl-x86_64.tar.gz -C piper1-gpl/libpiper/build libpiper.so
mkdir -p /tmp/onnx && find piper1-gpl/libpiper/build/piper1-gpl/libpiper/install/lib -name "libonnxruntime*.so*" -exec cp -P {} /tmp/onnx/ \; && tar -czf libonnxruntime-linux-musl-x86_64.tar.gz -C /tmp/onnx .

- name: Upload packaged artifacts
uses: actions/upload-artifact@v7
with:
name: piper-release-musl
path: |
libpiper-linux-musl-x86_64.tar.gz
libonnxruntime-linux-musl-x86_64.tar.gz
retention-days: 7

publish:
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ are not part of it.
`test-integration` run only for code changes. `ci-ok` aggregates the results and is the check to require.

Tag pushes (`v*`) run `.github/workflows/release.yml`: it builds libpiper for glibc and musl,
packages the five archives that `piper-tts install-deps` downloads, and creates the GitHub
packages the four archives (`piper-tts install-deps` downloads the three glibc ones), and creates the GitHub
Release from the `CHANGELOG.md` section.

## License
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ All notable changes to this project are documented here, following

## [Unreleased]

### Changed

- libpiper (the `piper1-gpl` submodule) is upgraded from v1.4.1 to v1.8.0 (ONNX Runtime stays at
1.22.0 for glibc). The `piper.h` changes are additive (`piper_create_with_options`,
`piper_version`, `EXPORT_SYMBOL`), so the FFI definitions and the public PHP API are
unchanged. Closes #21; replaces Dependabot PR #3.
- The musl build (CI and release) runs in `alpine:3.23` and links the Alpine `onnxruntime` package
(1.23.0) instead of the prebuilt glibc-only ONNX Runtime, which no longer links on musl since
libpiper builds the `piper` executable too. Because that package is not ours to redistribute with
its dependencies, the release no longer has `libonnxruntime-linux-musl-x86_64.tar.gz` (it held a
glibc library that cannot be loaded on musl). On Alpine run `apk add onnxruntime-dev` and use
`libpiper-linux-musl-x86_64.tar.gz` with `espeak-ng-data.tar.gz`. The glibc assets are unchanged.
- libpiper now installs the espeak-ng data to `share/espeak-ng-data` instead of `espeak-ng-data`;
`make build-libs`, CI and the release workflow use the new path.

## [0.2.0] - 2026-10-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ build-libs: build-libpiper
mkdir -p $(LIBS_DIR)
cp $(LIBPIPER_BUILD_DIR)/libpiper.so $(LIBS_DIR)/
cp $(LIBPIPER_INSTALL_DIR)/lib/libonnxruntime.so* $(LIBS_DIR)/ 2>/dev/null || cp $(LIBPIPER_INSTALL_DIR)/lib/libonnxruntime*.so* $(LIBS_DIR)/
cp -r $(LIBPIPER_INSTALL_DIR)/espeak-ng-data $(LIBS_DIR)/
cp -r $(LIBPIPER_INSTALL_DIR)/share/espeak-ng-data $(LIBS_DIR)/
@echo "Libraries ready in $(LIBS_DIR)/"
@echo " - libpiper.so"
@echo " - libonnxruntime.so (and versioned files)"
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ tar -xzf libonnxruntime-linux-x86_64.tar.gz
tar -xzf espeak-ng-data.tar.gz
```

On Alpine Linux (musl) use `libpiper-linux-musl-x86_64.tar.gz` instead of the two glibc
libpiper and ONNX Runtime archives, together with `espeak-ng-data.tar.gz`. Install ONNX Runtime
from the Alpine package: `apk add onnxruntime-dev` (the musl build of libpiper is linked
against it).

### Building from Source

If you prefer to build from source or need a different architecture:
Expand Down
7 changes: 3 additions & 4 deletions docs/release-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ file from the **tagged commit**, so the release PR with the `## [X.Y.Z]` section
must be **merged before** you tag.

The workflow builds libpiper from the `piper1-gpl` submodule on Linux (glibc on
`ubuntu-latest`, musl in an `alpine:3.18` container) and packages five archives:
`ubuntu-latest`, musl in an `alpine:3.23` container) and packages four archives:

| Asset | Content |
|---|---|
| `libpiper-linux-x86_64.tar.gz` | `libpiper.so` (glibc) |
| `libonnxruntime-linux-x86_64.tar.gz` | ONNX Runtime shared libraries (glibc) |
| `espeak-ng-data.tar.gz` | espeak-ng phoneme data |
| `espeak-ng-data.tar.gz` | espeak-ng phoneme data (glibc and musl) |
| `libpiper-linux-musl-x86_64.tar.gz` | `libpiper.so` (musl) |
| `libonnxruntime-linux-musl-x86_64.tar.gz` | ONNX Runtime shared libraries (musl) |

It then creates the GitHub Release with `gh release create --verify-tag`, using the
notes from the matching `CHANGELOG.md` section, and attaches the archives. It fails
Expand Down Expand Up @@ -116,5 +115,5 @@ Make sure the next milestone `vX.Y.(Z+1)` (or the next minor) exists.
- [ ] CHANGELOG section `[X.Y.Z] - date` written, `[Unreleased]` is empty
- [ ] Release PR merged
- [ ] Annotated tag `vX.Y.Z` pushed
- [ ] GitHub Release exists with the CHANGELOG notes and the five libpiper/ONNX Runtime/espeak-ng archives
- [ ] GitHub Release exists with the CHANGELOG notes and the four libpiper/ONNX Runtime/espeak-ng archives
- [ ] Milestone closed, next milestone exists
2 changes: 1 addition & 1 deletion piper1-gpl
Submodule piper1-gpl updated 77 files
+91 −0 .github/workflows/build-libpiper.yml
+1 −1 .github/workflows/test.yml
+44 −0 CHANGELOG.md
+1 −1 CMakeLists.txt
+4 −0 README.md
+10 −0 docs/ALIGNMENTS.md
+19 −3 docs/API_HTTP.md
+2 −2 docs/VOICES.md
+9 −0 libpiper/ .clang-format
+11 −0 libpiper/.clang-tidy
+3 −0 libpiper/.gitignore
+104 −17 libpiper/CMakeLists.txt
+21 −0 libpiper/ClangTidy.cmake
+15 −3 libpiper/README.md
+68 −0 libpiper/include/chinese_phonemizer.h
+125 −5 libpiper/include/piper.h
+64 −44 libpiper/include/piper_impl.hpp
+463 −0 libpiper/src/chinese_phonemizer.cpp
+32 −0 libpiper/src/main/CMakeLists.txt
+150 −0 libpiper/src/main/main.cpp
+160 −0 libpiper/src/main/utils/main_utils.cpp
+47 −0 libpiper/src/main/utils/main_utils.hpp
+94 −0 libpiper/src/main/utils/process.cpp
+10 −0 libpiper/src/main/utils/process.hpp
+43 −0 libpiper/src/main/utils/wav_headers.cpp
+8 −0 libpiper/src/main/utils/wav_headers.hpp
+22 −0 libpiper/src/main/utils/wavfile.cpp
+10 −0 libpiper/src/main/utils/wavfile.hpp
+671 −343 libpiper/src/piper.cpp
+5 −0 libpiper/tests/.clang-tidy
+82 −0 libpiper/tests/CMakeLists.txt
+195 −0 libpiper/tests/DownloadModel.cmake
+176 −0 libpiper/tests/test_main_utils.cpp
+695 −0 libpiper/tests/test_piper.cpp
+154 −0 libpiper/tests/test_process.cpp
+43 −0 libpiper/tests/test_wav_headers.cpp
+42 −0 libpiper/tests/test_wavfile.cpp
+37 −0 libpiper/tests/utils/piper_test_assets.cpp
+36 −0 libpiper/tests/utils/piper_test_assets.h
+209 −0 licenses/LICENSE.g2pW-Apache-2.0
+10 −0 mypy.ini
+8 −0 script/setup
+57 −6 setup.py
+5 −2 src/piper/__main__.py
+27 −1 src/piper/config.py
+531 −0 src/piper/g2pw_onnx.py
+20 −0 src/piper/hebrew/LICENSE
+1 −0 src/piper/hebrew/SOURCE
+165 −0 src/piper/hebrew/__init__.py
+494 −0 src/piper/hebrew/hebrew_ipa.py
+ − src/piper/hebrew/nakdimon.onnx
+75 −7 src/piper/http_server.py
+ − src/piper/img/logo.png
+ − src/piper/img/ohf-library.png
+50 −31 src/piper/patch_voice_with_alignment.py
+6 −0 src/piper/phoneme_ids.py
+3 −3 src/piper/phonemize_chinese.py
+46 −2 src/piper/phonemize_espeak.py
+40 −0 src/piper/phonemize_hebrew.py
+343 −0 src/piper/phonemize_japanese.py
+293 −0 src/piper/phonemize_thai.py
+556 −0 src/piper/templates/index.html
+39 −1 src/piper/train/__main__.py
+171 −0 src/piper/train/infer_torch.py
+88 −32 src/piper/train/vits/dataset.py
+203 −62 src/piper/train/vits/lightning.py
+91 −0 src/piper/train/vits/models.py
+76 −0 src/piper/train/vits/mos.py
+67 −3 src/piper/voice.py
+9 −0 tests/__init__.py
+44 −1 tests/test_chinese_phonemizer.py
+63 −0 tests/test_espeak_phonemizer.py
+97 −0 tests/test_hebrew_phonemizer.py
+146 −0 tests/test_japanese_phonemizer.py
+262 −0 tests/test_piper.py
+229 −0 tests/test_thai_phonemizer.py
+15 −0 tests/test_voice.onnx.json
Loading