Local Qwen3-TTS backend used directly by the CLI or behind the inference server.
Source: screencastgen/providers/tts/qwen_backend.py
Implements the TTSBackend protocol using Qwen3-TTS for local text-to-speech synthesis. It supports:
ref_audio_path and ref_textsynthesize_batch(...) for the inference serverQwenTTS| Property | Value | Description |
|---|---|---|
max_chunk_bytes |
1500 |
Conservative text limit exposed to chunking and validation |
output_format |
"wav" |
Output audio format |
QwenTTS(
model_name=None,
ref_audio_path=None,
ref_text=None,
language="en-US",
device="auto",
)
| Param | Type | Default | Description |
|---|---|---|---|
model_name |
str \| None |
None |
Model alias or full Hugging Face model name |
ref_audio_path |
str \| None |
None |
Reference audio file for voice cloning |
ref_text |
str \| None |
None |
Transcript for the reference audio |
language |
str |
"en-US" |
Language code mapped to Qwen language labels |
device |
str |
"auto" |
Compute device |
| Method | Description |
|---|---|
synthesize(text, output_path) |
Generate one audio clip and write it to disk |
synthesize_batch(texts, language=None, ref_audio_path=None, ref_text=None) |
Generate multiple WAV payloads in one model call |
Default model:
Qwen/Qwen3-TTS-12Hz-0.6B-BaseBuilt-in aliases:
0.6b0.6B1.7b1.7BSupported language map includes:
Registered in TTS Registry with:
cli, serverlocal, voice_clone--modelThe inference server currently expects this backend to provide synthesize_batch(...).
The model download hook uses huggingface_hub.snapshot_download() to populate the cache without constructing the Qwen model. If the selected model value resolves to a local path, the download step leaves it unchanged.
Qwen Backend
├── qwen-tts (deferred import)
├── torch (deferred import)
├── soundfile (deferred import)
├── TTS Base (resolve_device, BackendSpec)
└──▶ registered in TTS Registry
TTSBackend protocol