mirror of
https://github.com/Nighthawk42/Qwen3-TTS-streaming.git
synced 2026-08-30 10:12:26 +00:00
Voice Cloning Assets
This directory contains the reference audio and text files needed for voice cloning functionality.
Files Required
ref_audio.wav
- Format: WAV (Waveform Audio File Format)
- Sample Rate: 24kHz or higher (will be automatically resampled if needed)
- Duration: 5-30 seconds recommended
- Content: Clear speech sample with natural pronunciation and emotion
- Language: Should match the languages you plan to synthesize
ref_text.txt
- Format: Plain text UTF-8
- Content: Exact transcription of the reference audio
- Purpose: Used for in-context learning (ICL) mode to match prosody and emotion
- Length: Should match the duration of
ref_audio.wav
Setup Instructions
-
Prepare Your Reference Audio
- Record or find a clear audio sample with good quality
- Ensure the audio is in WAV format
- Recommended duration: 10-20 seconds
-
Create Reference Text
- Transcribe the audio content accurately
- Include punctuation and capitalization
- Save as
ref_text.txtin UTF-8 encoding
-
Place Files in This Directory
assets/voice_cloning/ ├── ref_audio.wav └── ref_text.txt -
Verify Setup
- Check the API health endpoint:
GET /v1/health - If voice cloning is available, the API will automatically load the files
- The Gradio demo will show "Voice Cloning: Yes" when ready
- Check the API health endpoint:
Example Reference Text
For a Russian speaker:
Это брат Кэти, моей одноклассницы. А что у тебя с рукой?
И почему ты голая? У него ведь куча наград по боевым искусствам.
For an English speaker:
Good one. Okay, fine, I'm just gonna leave this sock monkey here. Goodbye.
Voice Cloning Modes
The API supports two voice cloning modes:
-
ICL Mode (In-Context Learning) - Default
- Uses both the reference audio codes and speaker embedding
- Requires accurate
ref_text.txt - More expressive but slightly slower
- Best for preserving voice characteristics and emotion
-
X-Vector Only Mode
- Uses only the speaker embedding
- Does not require
ref_text.txt - Faster generation
- Good for voice similarity without exact prosody matching
Troubleshooting
Voice cloning not available
- Check that both
ref_audio.wavandref_text.txtexist in this directory - Verify file names are exact (case-sensitive on Linux/Mac)
- Check that the audio file is readable and valid
Poor voice quality
- Use a clearer reference audio sample
- Ensure the reference text exactly matches the audio
- Try a different reference speaker
API errors with voice cloning
- Check the API logs for specific error messages
- Verify the audio file is not corrupted
- Ensure sufficient system memory (model requires VRAM/RAM)
Supported Languages
The Qwen3-TTS model supports voice cloning for multiple languages:
- English
- Russian
- Chinese (Simplified & Traditional)
- Japanese
- Korean
Choose appropriate reference audio for your target language.