piper-phonemize
Try it Online
You can try piper-phonemize directly in your browser using WebAssembly:
- Hugging Face Spaces: https://huggingface.co/spaces/csukuangfj/piper-phonemize
- ModelScope Studios (for users in China, 中文用户): https://modelscope.cn/studios/csukuangfj/piper-phonemize/summary
Introduction
Phonemization library for Piper text-to-speech system.
Converts text to IPA phonemes using espeak-ng.
Supports Python, Go, JavaScript (Node.js/WASM), and C/C++.
Installation
Python
Go
JavaScript / Node.js
WASM version (works everywhere, no native dependencies):
Native addon (better performance, requires platform-specific binary, which is installed automagically):
C / C++
Download pre-built libraries from GitHub Releases or build from source.
Quick Start
Python
# Initialize espeak-ng
# Phonemize text
=
Go
package main
import (
"fmt"
pp "github.com/csukuangfj/piper-phonemize-go/piper_phonemize"
)
func main()
JavaScript / Node.js
WASM version:
const piperPhonemize = require;
// espeak-ng-data is bundled — no initialization needed!
const result = piperPhonemize.;
console.log; // ['həlˈoʊ wˈɜːld']
Native addon:
const piperPhonemize = require;
// espeak-ng-data is bundled — no initialization needed!
const result = piperPhonemize.;
console.log; // ['həlˈoʊ wˈɜːld']
C
int
Building from Source
Using CMake
Using Docker
License
GPL-3.0-or-later (due to espeak-ng dependency)