Instructions to use Phoonnx/phoonnx-chatterbox with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Chatterbox
How to use Phoonnx/phoonnx-chatterbox with Chatterbox:
# pip install chatterbox-tts import torchaudio as ta from chatterbox.tts import ChatterboxTTS model = ChatterboxTTS.from_pretrained(device="cuda") text = "Ezreal and Jinx teamed up with Ahri, Yasuo, and Teemo to take down the enemy's Nexus in an epic late-game pentakill." wav = model.generate(text) ta.save("test-1.wav", wav, model.sr) # If you want to synthesize with a different voice, specify the audio prompt AUDIO_PROMPT_PATH="YOUR_FILE.wav" wav = model.generate(text, audio_prompt_path=AUDIO_PROMPT_PATH) ta.save("test-2.wav", wav, model.sr) - Notebooks
- Google Colab
- Kaggle
phoonnx-chatterbox
Mirror of the base (English) Chatterbox
model by Resemble AI, exported to ONNX for
phoonnx, OpenVoiceOS's offline TTS
library. Chatterbox is an autoregressive codec-LM: a Llama-based language
model generates discrete speech tokens conditioned on text and a reference
speaker, which are then decoded to a waveform. It is phoonnx's first
autoregressive engine, and its standout feature is zero-shot cloning from a
reference clip with no transcription needed, plus an exaggeration control
for expressiveness. See
docs/training/engines/chatterbox.md
for the full architecture and
docs/cloning.md
for the cloning walkthrough.
The ONNX export (onnx-community/chatterbox-ONNX)
splits the model into four graphs, all present here: embed_tokens,
language_model_q4 (4-bit quantized Llama LM), speech_encoder, and
conditional_decoder, plus the matching tokenizer.json.
Related repositories: phoonnx-chatterbox-turbo (faster GPT-2-based variant), phoonnx-chatterbox-multilingual (30 languages), phoonnx-chatterbox-lahgtna (Arabic dialects).
Usage
Cloning support requires pip install phoonnx[cloning].
import wave
from phoonnx.model_manager import TTSModelManager
manager = TTSModelManager()
manager.load()
manager.merge_default_voices()
voice = manager.voices["chatterbox/base/en"].load()
with wave.open("out.wav", "wb") as wav_file:
voice.synthesize_wav(
"Hello, this is a test.",
wav_file,
speaker_reference="reference.wav", # optional: clone this speaker
)
License
Resemble AI released Chatterbox, including this base checkpoint, under the
MIT license (see ResembleAI/chatterbox
and the onnx-community/chatterbox-ONNX
export). phoonnx itself is Apache-2.0.