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.0

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.0
File Size Uploaded Provenance Actions
phononsynth-0.1.0.tar.gz 69.2 kB Without provenance Details for phononsynth-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 92.5 kB

Release files / phononsynth-0.1.0.tar.gz

Download URL phononsynth-0.1.0.tar.gz
Size 69.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c524dfff50e0d97f7699f99b9a3fda4c7bd365a635645d23671edab7f70c6ed0
BLAKE2b-256 checksum
How to use checksums
15d98c9d18f64d48e82b3e39ae253618737299be9da4e0cc91d3f723f4c387ec
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.0-py3-none-any.whl

Download URL phononsynth-0.1.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34329b96af5dd8dc1c16b222f26c56336f28615d86c64bd79dd803b30639489c
BLAKE2b-256 checksum
How to use checksums
134a9ee4381c89e7fac0385aa6a5cb999089b1dc06ea88090bf4467cc993513f
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.0

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