Audio version — Estimated duration: 2 min 47 sec

Generate your first audio file in under two minutes.

Prerequisites

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:

  1. Script loads Qwen3-TTS-12Hz-0.6B-CustomVoice from the local directory
  2. Reads sample.md (24 lines of Markdown) and strips formatting
  3. Splits cleaned text into chunks of ~150 characters
  4. Feeds each chunk to the model with speaker “Ryan” and instruction “Speak naturally.”
  5. 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:

  1. Loads Qwen3-TTS-12Hz-0.6B-Base
  2. Pre-computes a voice embedding from your reference audio + transcript
  3. Chunks and generates audio conditioned on that embedding
  4. 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


Next: Voice Cloning Guide or Preset Voices Guide