loudkit
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Text-to-speech that runs on your own hardware.**
loudkit has 28 voices in ten languages, clones a voice from about ten seconds
of audio, and has native SDKs for Python, Swift, Go, Rust and TypeScript. After
the first model download it runs offline. It needs no account, sends no
telemetry and has no usage fees.
LoudReader, a reading app, uses loudkit as its speech
engine. loudkit is licensed under Apache-2.0.
**Hear the voices** |
**Try the online demo** |
**Open in Colab** |
Model |
Documentation
Quickstart
The first run downloads the 747 MB model and the 28 voices. After that, it runs
offline. speak writes out.wav by default, and --play plays it with the
system player. Use -o hello.wav to choose the file name. Other English voices
work the same way, for example --voice kathleen or --voice henry. A voice
reads text in its own language unless you pass --language.
Python
engine.voices() lists the 28 names. All 28 voices are in both model downloads
and load by name. synthesize splits long text into chunks and returns one
waveform. engine.stream(...) yields the same audio chunk by chunk, so
playback can start early.
Read Getting started
next.
Swift, Go, Rust and TypeScript
Each port loads the model by name. The first call downloads and verifies it,
and later calls run offline. The snippets need version 0.1.1 of each package.
**Swift** (CoreML, macOS 14 or iOS 17). Add
.package(url: "https://github.com/loudreader/loudkit", from: "0.1.1") to
Package.swift. Guide.
**Go** (ONNX Runtime). go get github.com/loudreader/loudkit/go@v0.1.1.
Guide.
**Rust** (ONNX Runtime). cargo add loudkit@0.1.1.
Guide.
**TypeScript** (ONNX Runtime, Node 20). npm install loudkit@0.1.1.
Guide.
Go and Rust need libonnxruntime on the machine (brew install onnxruntime,
or a build from the ONNX Runtime releases); the guides say where each port
looks for it. All five implementations pass the same conformance fixture. The
identity contract
states where their speech tokens match and where they can differ.
Two models
loudreader/loudr-1 is the default. loudreader/loudr-1-turbo is faster and
sounds slightly less natural. Both run on every backend and in all five SDKs.
Select the model with the string you pass to load. See
Choosing a model.
Voices
The voice gallery plays all
28 voices next to the recording each was enrolled from. The ten languages are
English, Spanish, French, German, Italian, Polish, Portuguese, Dutch, Swedish
and Danish. English has ten voices, and each other language has two.
VOICES.md records
the source, licence and consent basis of each voice. The voices come from
recordings donated for speech technology, or from CC0 and CC-BY corpora.
Only English has been evaluated by ear. The other nine languages have automated
checks but no native-speaker review. If you speak one of them, please listen
and report what sounds wrong.
Clone a voice
Use five to ten seconds of one speaker, from a recording you own or have
permission to use:
The result is a portable voice profile of about 150 KB. By default,
loudkit clone cuts the recording at a pause and pads its end with silence.
lk.enroll(...) in Python and enroll in each port keep the recording as
given. To get the loudkit clone result from Python, pass
end_in_silence=True to lk.enroll. See
Cloning a voice
and Responsible use.
Measured speed
| path | hardware | loudr-1 | loudr-1-turbo |