Skip to main content

phononsynth

A user-facing Phonon text-to-speech frontend backed by OnnxVoice. PhononSynth loads the bundle's tokenizer.json, converts text to token IDs, and passes generation controls to OnnxVoice. OnnxVoice owns catalog discovery, direct-file downloads, integrity checks, cache management, and the streaming ONNX runtime.

Install and synthesize

Install the CPU extra, inspect the live catalog, then save a WAV:

python -m pip install "phononsynth[cpu]"
phononsynth --list-models
phononsynth "Hello from Phonon." --model phonon-31m-en --quality q4 -o hello.wav

phononsynth[cpu] supplies the OnnxVoice CPU runtime as well as PhononSynth. Use phononsynth[gpu] for GPU runtime support. Normal Phonon bundle installation downloads direct per-file HTTPS release assets; it does not require Hugging Face. The optional phononsynth[huggingface] extra is only for workflows that actually use OnnxVoice's Hugging Face transport.

--list-models reads the active catalog and does not install model graphs. Its JSON includes each published model's active release_version, live quality choices, voices/default voice, languages, SPDX license, and commercial-use status. Available models and qualities can change with the catalog; use the values it reports rather than assuming every model supports every quality. The release version is intentionally reported from the catalog, not hardcoded here.

Python API

from phononsynth import PhononVoice

with PhononVoice.from_pretrained(
    "phonon-31m-en",
    quality="q4",
    cache_dir="~/.cache/phononsynth",
) as model:
    result = model.synthesize_prepared("Hello from Phonon.", seed=7)
    result.save_wav("hello.wav")
    print(result.metadata)  # model, quality, release/source provenance, token count, generation

Use the catalog's actual quality choices. Passing quality=None leaves quality resolution to OnnxVoice and preserves its catalog default. Set offline=True with the same cache directory to reopen an already installed model without network access.

Streaming

Streaming forwards chunks directly from the runtime; it does not buffer the full utterance:

from phononsynth import PhononVoice

with PhononVoice.from_pretrained("phonon-31m-en", quality="q4") as model:
    for chunk in model.stream_prepared("Streaming speech.", seed=7):
        consume(chunk.audio, chunk.sample_rate)

Each chunk carries float32 mono audio, its sample rate, frame index, EOS status, and EOS logit when provided by the runtime.

Local bundle

PhononVoice.from_local() opens a task-01 canonical bundle directly, without registering it in the managed cache:

bundle/
  config.json
  tokenizer.json
  onnx/
    text_conditioner.onnx
    flow_lm_main.onnx
    flow_lm_flow.onnx
    mimi_decoder.onnx
  voices/
    <voice>.bin

The config declares runtime.kind and runtime.sample_rate; voices may be declared as a sequence or a name-to-metadata mapping. The bundle must include a .bin prompt for every declared voice.

with PhononVoice.from_local(bundle_dir="bundle") as model:
    model.synthesize_prepared("Local synthesis.").save_wav("local.wav")

Generation controls and text limits

The CLI exposes --voice, --duration-delta, --temperature, --seed, --eos-threshold, --frames-after-eos, --min-frames-before-eos, and --max-frames. The Python API accepts these individually or through SynthesisConfig, but not both in one call. Unset controls use bundle defaults when present. Missing controls use Phonon-compatible defaults, including temperature 0.3, one frame after EOS, six frames before EOS detection, and a token-length-based frame cap.

PhononSynth uses the installed bundle tokenizer and validates empty text before inference. The current Phonon runtime contract does not declare a maximum input-token limit, so measure_prepared() reports a real token count with max_tokens=None and fits=None. PhononSynth does not invent a limit or automatically split long text.

Model licenses

The Python package license and model-artifact licenses are separate. Check each model's live SPDX and commercial_use values in phononsynth --list-models before downloading or using its artifacts. The 40m checkpoints are CC-BY-NC-4.0 and non-commercial only. This warning is not a grant of commercial rights; comply with the model license and required notices.

Scope

PhononSynth is a tokenizer/frontend for Phonon's streaming generation contract. It does not implement voice cloning, pronunciation overrides, word timings, text splitting, or long-form orchestration.

Metadata

Release files for phononsynth 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phononsynth 0.1.1
File Size Uploaded Provenance Actions
phononsynth-0.1.1.tar.gz 74.6 kB Without provenance Details for phononsynth-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for phononsynth 0.1.1
File Interpreter ABI Platform Actions
phononsynth-0.1.1-py3-none-any.whl Python 3 none any Details for phononsynth-0.1.1-py3-none-any.whl

Total release size: 98.0 kB

Release files / phononsynth-0.1.1.tar.gz

Download URL phononsynth-0.1.1.tar.gz
Size 74.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9718b9d144a321c38a998850f24f64621702c88e71ad3dc4ee92bd8ac9a7db5b
BLAKE2b-256 checksum
How to use checksums
78f840db307b67cd4b221d44af836cc42eb6dc4ca094aa1798800b4310f0a3c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / phononsynth-0.1.1-py3-none-any.whl

Download URL phononsynth-0.1.1-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4da2bb08b237f325e5c9fb3746c997ab571bfb759b142d175f3378794761d744
BLAKE2b-256 checksum
How to use checksums
8bf507108ac995f584e441c7d2779e6b78111780003ae7e95717a19081547abe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for phononsynth 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page