Audio version — Estimated duration: 2 min 47 sec
Generate your first audio file in under two minutes.
Prerequisites
- You’ve installed dependencies and downloaded at least one model
- A Markdown file to convert — use the included
sample.md - You’re in the project root directory
Preset voice (easiest — no reference needed)
This uses the CustomVoice model with a built-in speaker. No audio sample required.
python md_to_audio_custom.py sample.md --speaker "Ryan"What happens:
- Script loads
Qwen3-TTS-12Hz-0.6B-CustomVoicefrom the local directory - Reads
sample.md(24 lines of Markdown) and strips formatting - Splits cleaned text into chunks of ~150 characters
- Feeds each chunk to the model with speaker “Ryan” and instruction “Speak naturally.”
- Concatenates the generated audio and writes
output_custom.wav
First run is slower (model loading + GPU warm-up). Subsequent runs reuse cached model.
Output: output_custom.wav — 24 kHz mono, ~15–30 seconds for sample.md depending on chunk size and GPU.
Voice cloning (requires reference audio)
If you have a voice sample you want to replicate:
python md_to_audio_base.py sample.md \
--ref_audio "my_voice.wav" \
--ref_text "the exact transcript of what was said in my_voice.wav"What happens:
- Loads
Qwen3-TTS-12Hz-0.6B-Base - Pre-computes a voice embedding from your reference audio + transcript
- Chunks and generates audio conditioned on that embedding
- Writes
output.wav
Listening to the output
# Linux — play with aplay, ffplay, or your media player
aplay output_custom.wav
ffplay -nodisp -autoexit output_custom.wav
# Cross-platform Python
python -c "import soundfile as sf, numpy as np; data, sr = sf.read('output_custom.wav'); print(f'{len(data)/sr:.1f}s audio')"What to try next
- Voice cloning guide — detailed tips for good clones
- Preset voices guide — explore all 9 speakers
- Base script CLI — tune chunk size, batch size
- CustomVoice script CLI — change dtype, instructions
Next: Voice Cloning Guide or Preset Voices Guide