Onyx-TTS is a high-performance, multilingual text-to-speech system developed by 0N Labs. It's built on ONNX Runtime, delivering fast and efficient speech synthesis with minimal resource requirements.
Create and activate a virtual environment (recommended):
bash
1python -m venv venv
2source venv/bin/activate # On Windows: venv\Scripts\activate
Install the required dependencies:
pip install -r requirements.txt
Downloading the Model
Download the model files from the Releases page and place them in your project directory:
onyx-v1.0.onnx (main model)
voices-v1.0.bin (voice data)
Basic Usage
python
1import soundfile as sf
2from onyx_tts import OnyxTTS
34# Initialize the TTS engine with the downloaded model files5onyx = OnyxTTS("onyx-v1.0.onnx","voices-v1.0.bin")67# Generate speech8samples, sample_rate = onyx.create(9"Hello! This is Onyx TTS by 0N Labs.",10 voice="af_sarah",# See available voices in VOICES.md11 speed=1.0,# Adjust speed (0.5–2.0)12 lang="en-us"13)1415# Save the generated audio16sf.write("output.wav", samples, sample_rate)17print("Speech generated successfully!")