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 to measure the exact prepared request. The current Phonon runtime does not declare a finite text-token maximum, so measure_prepared() returns max_tokens=None. Successful measurement nevertheless returns fits=True: the exact request satisfies all declared PhononSynth input-capacity constraints. PhononSynth does not invent a finite token limit and does not 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.2

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.2
File Size Uploaded Provenance Actions
phononsynth-0.1.2.tar.gz 75.4 kB Without provenance Details for phononsynth-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 98.9 kB

Release files / phononsynth-0.1.2.tar.gz

Download URL phononsynth-0.1.2.tar.gz
Size 75.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5e5efba4c8f48271b21b8be02401ab4b1d96e80f480907bd41db1327b0c16068
BLAKE2b-256 checksum
How to use checksums
cdc71d8dae83c7379dd819353b919e0dace60d03eb87d2ea0725d86f4d54543e
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.2-py3-none-any.whl

Download URL phononsynth-0.1.2-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e560d5b9f14b35d1726990436d76dc014324b5961b975b516951850d55734377
BLAKE2b-256 checksum
How to use checksums
8b8dcf79f29b7f501b03c31baa2a8b37bb077f99308c6baf896dffe5a8864c55
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.2

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